[Malvern] Perl Script Errors

Stuart Bird e_tective at yahoo.co.uk
Fri Jul 13 10:29:51 BST 2007


Hi All

Being new to the list I am not sure what the message content rules are
so if this is off topic I apologise.

Being very new to Perl I have been working through a script which I hope
will eventually allow a user to enter the full path to a file then have
the script extract certain plain text entries from the file then write
the extracted entries to another file. It is still under construction so
some of the anticipated functionality mentioned above has not been
written in yet.


I have two problems with it at the moment:

1) I keep getting this error when I try and run the script:

stu at debian:~/Scripts$ ./skype_2.pl
syntax error at ./skype_2.pl line 10, near ")

print"
Execution of ./skype_2.pl aborted due to compilation errors.

Line 10, mentioned in the error looks alright to me, it's just a simple
print instruction. Am I missing something obvious?

2) The regexp "thingy" in the while statement is not being found, even
though I know that it exists in the target file in plain text. I have no
idea why?


Here is the script in its current form:


#!/usr/bin/perl
use strict;
use warnings;

print "Skype Chat Log DeCoder.\n";

my ($path, $output)

print "Enter the full path of the file to be decoded:";
chomp($path = <STDIN>);

open(FILE, $path) or die "Can't open $path: $!";

while ($output = <FILE>) {

   if (/thingy/) {

      print $output;

   }

}

close(FILE); 


Any advice appreciated. As I said above, I am very new to perl so please
be gentle with me in any replies :)

Stu Bird




More information about the Malvern mailing list