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

Capture and play voice with Asterisk ARI -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -

visual studio - Installing Packages through Nuget - "Central Directory corrupt" -