BOLCATO CHRIS (esm1cmb) wrote:
I added
1;
Inside sub foo and it didn't work, but I just added it to the end of foo.pl
and it worked!
I don't get it?
the 1; at the end of a file you're sue()ing returns true for the use
statement. otherwise it won't be true and therefore fail..
HTH
Lee.M - Jupit
On Fri, 9 Jul 2004 13:36:26 -0400 , Bob Showalter wrote
> BOLCATO CHRIS (esm1cmb) wrote:
> > I am receiving "/home/users/me/foo.pl did not return a true value at
> > ./program1.pl at line 2"
> > where line 2 is the "require".
>
> That's the semantics of "require" (see perldoc -f require).
>
> Th
e error when it "couldn't"
(aka it thought it couldn't because it didn't return true).
> But thanks.
>
Makes sense?
http://danconia.org
> -Original Message-
> From: Bob Showalter [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 09, 2004 1
D]
Subject: RE: Help with "use"
BOLCATO CHRIS (esm1cmb) wrote:
> It doesn't seem to be foo.pl that is causing the error is seems to be
> coming from "use AnyDBM_File;"
Why do you say that?
> Could this be? That AnyDBM_File doesn't return a true vlaue?
Di
BOLCATO CHRIS (esm1cmb) wrote:
> It doesn't seem to be foo.pl that is causing the error is seems to be
> coming from "use AnyDBM_File;"
Why do you say that?
> Could this be? That AnyDBM_File doesn't return a true vlaue?
Did you add
1;
To the end of foo.pl? You need to.
--
To unsubscribe,
PM
To: BOLCATO CHRIS (esm1cmb); 'Wiggins d Anconia'; [EMAIL PROTECTED]
Subject: RE: Help with "use"
BOLCATO CHRIS (esm1cmb) wrote:
> I am receiving "/home/users/me/foo.pl did not return a true value at
> ./program1.pl at line 2" where line 2 is the "require
BOLCATO CHRIS (esm1cmb) wrote:
> I am receiving "/home/users/me/foo.pl did not return a true value at
> ./program1.pl at line 2"
> where line 2 is the "require".
That's the semantics of "require" (see perldoc -f require).
The standard idiom is to place
1;
at the end of foo.pl, so that the la
BOLCATO CHRIS (esm1cmb) wrote:
> Hello all,
> Can "use" be used in a sub routine that is kept external?
Yes.
> Ex.
> Program 1.
>
> #!/bin/perl
> require '/home/users/me/foo.pl';
> exit;
>
>
> Foo.pl
>
> sub bar {
> use strict;
> use fcntl;
> use AnyDBM_File;
> }
This would not be a typical
b); [EMAIL PROTECTED]
Subject: Re: Help with "use"
>
> Hello all,
> Can "use" be used in a sub routine that is kept external?
> Ex.
> Program 1.
>
> #!/bin/perl
> require '/home/users/me/foo.pl';
> exit;
>
>
> Foo.pl
>
> s
>
> Hello all,
> Can "use" be used in a sub routine that is kept external?
> Ex.
> Program 1.
>
> #!/bin/perl
> require '/home/users/me/foo.pl';
> exit;
>
>
> Foo.pl
>
> sub bar {
> use strict;
> use fcntl;
> use AnyDBM_File;
> }
>
Did you try it? Did it return an error? Note that 'require'
Tin-Shan Chau <[EMAIL PROTECTED]> wrote:
> I have a module as follows:
>
> package Test;
> require Exporter;
> our @ISA = qw(Exporter);
> our @EXPORT = qw(print_name print_test);
> sub print_test() {
>print "test\n";
> }
> sub print_name() {
>my $f
I'm not completely sure, but here are a couple of things I am noticing:
1) The last line of your module should be a 1 on it's own line.
2) When you declare a sub, don't put the parentheses. Try changing the
line 'sub print_test(){' to 'sub print_test{'. It's possible that Perl
thinks you're
fast relief to computer stress call Up & Running
Because throwing it out the window is not an option.
> -Original Message-
> From: A Taylor [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, March 23, 2002 4:47 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject
Hi William, thanks for your time and help so far - it is much appreciated.
My perl interpreter is definately pointing to the correct file - I have run
other perl scripts successfully that point to #!/usr/bin/perl.
It is only when I try to use 'use HTML::Template;' that I get a server
error. Ca
14 matches
Mail list logo