Re: working example File::Taill

From: Richard Morse (remorse_at_partners.org)
Date: 03/19/04

  • Next message: Paul Lalli: "Re: DBI selectall_hashref problem"
    Date: Fri, 19 Mar 2004 15:23:26 -0500
    
    

    In article <Pine.GSO.4.58.0403192105350.19242@keg.cs.vu.nl>,
     David de Kloet <dskloet@cs.vu.nl> wrote:

    > 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).

    It's better not to pre-declare your variables -- declare them just where
    you'd need them...

    Ricky


  • Next message: Paul Lalli: "Re: DBI selectall_hashref problem"

    Relevant Pages

    • RE: perl question - unused variables
      ... declare a variable called '$nothing' in a script on working on now, ... Subject: RE: perl question - unused variables ... $abc; and using strict and -w, I do not get any warning. ...
      (perl.beginners)
    • Re: perl newbie: leaner code ideas
      ... > To learn Perl, I have written a bit of code that needs to do the following: ... Don't declare variables prematurely. ... if the foreach loop contriol variable has already been ... variable as a foreach loop contriol variable without an explicit "my". ...
      (comp.lang.perl)
    • Re: Sub routine location
      ... I am getting a little confused on how the script ... subroutines near the top of the code, ... Perl couldn't care less where you define your ... you must declare it before calling ...
      (comp.lang.perl.misc)
    • Re: Curses %$#@!
      ... >> Perl module names are case sensative. ... Don't use the low-level Socket module directly to implement IP sockets ... Do not declare all your variables up top. ... variables as lexically scoped in the smallest applicable scope unless ...
      (comp.lang.perl.misc)
    • Re: Please suggest - Issue with comparing values
      ... I have a perl file which is called from a ksh file. ... I have to execute a procedure and get the output parameter. ... Below is the SAMPLE script. ... You don't declare $db_handle. ...
      (comp.lang.perl.misc)