Re: working example File::Taill

From: David de Kloet (dskloet_at_cs.vu.nl)
Date: 03/19/04


Date: Fri, 19 Mar 2004 21:11:51 +0100

Jim roos:

> Hi there,
>
> As a newbie to perl i have problems to get the following script to run
> properly.
> I get the message
> Global symbol "$file" requires explicit package name at test.pl line 09
> Global symbol "$line" requires explicit package name at test.pl line 10
> Can someone help me out please...

I'm fairly new to perl but I believe you should add the line:
my($file, $line);
to declare your variables (since you use strict).

David

>
> Thank You.
>
>
> #!/usr/bin/perl
>
> use MIME::Parser;
> use strict;
> use File::Tail;
>
>
>
> $file=File::Tail->new("/home/noc/procmail");
> while (defined($line=$file->read)) {
> print "$line";
> }



Relevant Pages

  • Re: tricky list comparison problem
    ... > I'm having a bit of an issue with a script I'm working on. ... > - 69078878" as available sectors. ... > use strict(); ... You are telling perl to load the 'strict' module and then you are telling the ...
    (perl.beginners)
  • Re: Reading STDIN seems to be breaking my script
    ... CGI Perl script. ... As soon as the code is executed, the rest of the script doesn't ... It wouldn't run under strict. ... The commented-out code would very probably not work as intended ...
    (comp.lang.perl.misc)
  • Re: When to "use strict" when teaching?
    ... >>being influenced by the history of Perl ... history bias you" essentially the same as saying you are not ... An understanding of how symbolic references work is neither necessary ... I say don't expose people to the idea of omitting "use strict" until ...
    (comp.lang.perl.misc)
  • Re: working example File::Taill
    ... > As a newbie to perl i have problems to get the following script to run ... Thank you for using strict! ... The error messages are because you need to explicitly tell Perl what the ...
    (comp.lang.perl.misc)
  • Re: A newbie question - line number inside the script
    ... I'm a newbie to Perl, ... use strict; ... use warnings; ...
    (perl.beginners)