Perl - Script working in Padre, Windows. But not in Linux Ubuntu -


i've tried transfer script on i've been working on in windows. fails @ first hurdle.

use strict; use warnings;  $keywordfile = 'keyword.txt';          open(keywords, $keywordfile) or die "$keywordfile not found\n";  @keywordarray;  while ( $line = <keywords> ) {     chomp $line;     push @keywordarray, $line; }  close(keywords); 

it keeps on dying, though in same destination there file called 'keyword.txt'. issue coming ubuntu, or perl wrong?

it keeps on dying, though in same destination there file called 'keyword.txt'

relative paths resolved against working directory (i.e. directory script run from), not directory in script located.

you should either

  1. run script directory contains needed files
  2. use findbin module script location , use path refer file names:

eg.

use finbin; $keywordfile = "$findbin::bin/keyword.txt"; 

Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -