Import other perl files

Discussion in 'Perl Misc' started by Robin Wilson, Feb 27, 2006.

  1. Robin Wilson

    Robin Wilson Guest

    I have a perl file which I would like to divide up into 2 perl files so that
    the content is seperate

    I created 2 files and then moves some variables into the other file but I
    cannot work out how to include the second file

    I thought the syntax was:

    USE FILE.PL

    but that's not working

    Please can someone tell me the correct syntax

    Thanks
    Robin
     
    Robin Wilson, Feb 27, 2006
    #1
    1. Advertising

  2. "Robin Wilson" <> wrote in
    news:lJKMf.5852$:

    > I have a perl file which I would like to divide up into 2 perl files
    > so that the content is seperate
    >
    > I created 2 files and then moves some variables into the other file
    > but I cannot work out how to include the second file
    >
    > I thought the syntax was:
    >
    > USE FILE.PL


    use not USE. Case matters.

    perldoc use

    > but that's not working
    >
    > Please can someone tell me the correct syntax


    Reading the docs will tell you that.

    You should also read:

    perldoc perlmod

    Sinan

    --
    A. Sinan Unur <>
    (reverse each component and remove .invalid for email address)

    comp.lang.perl.misc guidelines on the WWW:
    http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
     
    A. Sinan Unur, Feb 27, 2006
    #2
    1. Advertising

  3. Robin Wilson

    Keith Keller Guest

    On 2006-02-27, A. Sinan Unur <> wrote:
    >
    > perldoc use


    Do you mean perldoc -f use ?

    --keith


    --
    -francisco.ca.us
    (try just my userid to email me)
    AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
    see X- headers for PGP signature information
     
    Keith Keller, Feb 28, 2006
    #3
  4. Keith Keller <-francisco.ca.us> wrote in
    news:-francisco.ca.us:

    > On 2006-02-27, A. Sinan Unur <> wrote:
    >>
    >> perldoc use

    >
    > Do you mean perldoc -f use ?


    Of course. Thanks for catching that.

    Sinan
    --
    A. Sinan Unur <>
    (reverse each component and remove .invalid for email address)

    comp.lang.perl.misc guidelines on the WWW:
    http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
     
    A. Sinan Unur, Feb 28, 2006
    #4
  5. Robin Wilson wrote:
    > I have a perl file which I would like to divide up into 2 perl files sothat
    > the content is seperate
    >
    > I created 2 files and then moves some variables into the other file butI
    > cannot work out how to include the second file
    >
    > I thought the syntax was:
    >
    > USE FILE.PL
    >
    > but that's not working


    Do not use USE, use use ;-)

    --
    Josef Möllers (Pinguinpfleger bei FSC)
    If failure had no penalty success would not be a prize
    -- T. Pratchett
     
    Josef Moellers, Feb 28, 2006
    #5
  6. Keith Keller - Coward currys favour

    Keith Keller <-francisco.ca.us> trolled:

    [coward's words deleted]

    Keith Keller hides his PGP in this group to curry favour with people
    he wishes to impress. In alt.os.linux.slackware he advocates using
    PGP because he wishes to curry favour with people in that group he
    wishes to impress.

    Keith Keller is a coward fit for killfiles.
     
    rrrrrr rrrrrrrr, Feb 28, 2006
    #6
  7. A. Sinan Unur <> trolled:
    > Keith Keller <-francisco.ca.us> wrote in


    [deleteia]

    > Of course. Thanks for catching that.


    Please do not respond to Coward Keith Keller.
     
    eeeeee eeeeeeee, Feb 28, 2006
    #7
  8. At 2006-02-27 05:06PM, Robin Wilson <> wrote:
    > I have a perl file which I would like to divide up into 2 perl files so that
    > the content is seperate
    >
    > I created 2 files and then moves some variables into the other file but I
    > cannot work out how to include the second file
    >
    > I thought the syntax was:
    >
    > USE FILE.PL
    >
    > but that's not working
    >
    > Please can someone tell me the correct syntax


    I think what you want is: require './file.pl';
    'use' looks for a proper module with the proper file extension in
    particular locations.

    Make sure the last statement of file.pl returns a true value. e.g. "1;"

    --
    Glenn Jackman
    Ulterior Designer
     
    Glenn Jackman, Feb 28, 2006
    #8
  9. eeeeee eeeeeeee <> wrote:
    > A. Sinan Unur <> trolled:
    >> Keith Keller <-francisco.ca.us> wrote in

    >
    > [deleteia]
    >
    >> Of course. Thanks for catching that.

    >
    > Please do not respond to Coward Keith Keller.



    Please do not post to our newsgroup.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Feb 28, 2006
    #9
  10. Re: Keith Keller - Coward currys favour

    rrrrrr rrrrrrrr <> wrote:

    > Keith Keller is a coward fit for killfiles.



    Roger Maynard is a fool fit for killfiles.


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Feb 28, 2006
    #10
  11. Re: Keith Keller - Coward currys favour

    Tad McClellan <> trolled:
    > rrrrrr rrrrrrrr <> wrote:


    > > Keith Keller is a coward fit for killfiles.


    > Roger Maynard is a fool fit for killfiles.


    ?!?
     
    rrrrrr rrrrrrrr, Feb 28, 2006
    #11
  12. Re: Keith Keller - Coward currys favour

    rrrrrr rrrrrrrr wrote:
    > Keith Keller <-francisco.ca.us> trolled:
    >
    > [coward's words deleted]
    >
    > Keith Keller hides his PGP in this group to curry favour with people
    > he wishes to impress. In alt.os.linux.slackware he advocates using
    > PGP because he wishes to curry favour with people in that group he
    > wishes to impress.
    >
    > Keith Keller is a coward fit for killfiles.


    For one, Keith Keller uses a real name.
    So: who's a coward?

    --
    Josef Möllers (Pinguinpfleger bei FSC)
    If failure had no penalty success would not be a prize
    -- T. Pratchett
     
    Josef Moellers, Mar 1, 2006
    #12
  13. Re: Keith Keller - Coward currys favour

    Josef Moellers <> trolled:
    > rrrrrr rrrrrrrr wrote:
    > > Keith Keller <-francisco.ca.us> trolled:
    > >
    > > [coward's words deleted]
    > >
    > > Keith Keller hides his PGP in this group to curry favour with
    > > people he wishes to impress. In alt.os.linux.slackware he
    > > advocates using PGP because he wishes to curry favour with
    > > people in that group he wishes to impress.
    > >
    > > Keith Keller is a coward fit for killfiles.


    > For one, Keith Keller uses a real name.


    It may be a real name. But it's not his name.

    Keith Keller is a coward and a hypocrite who currys favour.
     
    rrrrrr rrrrrrrr, Mar 1, 2006
    #13
  14. Re: Keith Keller - Coward currys favour

    On 2006-03-01, rrrrrr rrrrrrrr <> wrote:
    > Josef Moellers <> trolled:
    >
    >> For one, Keith Keller uses a real name.

    >
    > It may be a real name. But it's not his name.


    Well, that still puts him one up on you...

    --
    David H. Adler - <> - http://www.panix.com/~dha/
    Freedom ain't nothing but a word, ain't nothing but a word. Let me
    see your ID. - Gil Scott-Heron, "Johannesburg"
     
    David H. Adler, Mar 1, 2006
    #14
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Muddy Coder
    Replies:
    0
    Views:
    314
    Muddy Coder
    Mar 6, 2009
  2. Jonathan Gowland
    Replies:
    0
    Views:
    109
    Jonathan Gowland
    Sep 13, 2003
  3. ngoc
    Replies:
    7
    Views:
    182
    zentara
    Jul 14, 2005
  4. martin
    Replies:
    1
    Views:
    132
    Jürgen Exner
    Apr 17, 2006
  5. miten
    Replies:
    1
    Views:
    350
    Peter Scott
    Jul 8, 2010
Loading...

Share This Page