[26737] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 8823 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 4 03:05:30 2006

Date: Wed, 4 Jan 2006 00:05:05 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 4 Jan 2006     Volume: 10 Number: 8823

Today's topics:
        calling subroutine <madhuram@nortel.com>
    Re: calling subroutine <noreply@gunnar.cc>
    Re: calling subroutine <tadmc@augustmail.com>
    Re: How to get image size in these conditions ? <tintin@invalid.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 3 Jan 2006 18:35:10 -0500
From: "Madhu Ramachandran" <madhuram@nortel.com>
Subject: calling subroutine
Message-Id: <dpf1ne$1nn$1@zcars129.ca.nortel.com>

hi,

iam new to perl. Iam getting an error in a subroutine invocation.

I have a main perl script say main.pl
I have a doThis.pl perl script in scripts subdir. So in main.pl i have the 
following

#file: main.pl
#!/usr/local/bin/perl

unshift(@INC, "./scripts);
require("common.pl");
&common_sub(); # this is in common.pl file in scripts subdir
system("scripts/doThis.pl");
##### end of main.pl ####

#File: scripts/doThis.pl
#!/usr/local/bin/perl

print ("Hello there\n");
&mysub();

sub mysub()
{
  print ("in mysub\n");
}
#### end of doThis.pl

I get error when i run
#perl main.pl
Undefined subroutine &main::mysub called at scripts/doThis.pl line 4, 
<STDIN> line 1.

If i take out the unshift() and require in main.pl, and also take out the 
call to common_sub, then
there is no error in call to mysub() in doThis.pl

would appreciate any help.
Thanks.

Madhu 




------------------------------

Date: Wed, 04 Jan 2006 01:26:05 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: calling subroutine
Message-Id: <420it4F1gk699U1@individual.net>

Madhu Ramachandran wrote:
> hi,
> 
> iam new to perl.

Then I can't help asking from where you got that programming style. It's 
very old, and should not be used in a Perl program of 2006.

Please study some tutorial or book from this millenium.
http://learn.perl.org/

> Iam getting an error in a subroutine invocation.
> 
> I have a main perl script say main.pl
> I have a doThis.pl perl script in scripts subdir. So in main.pl i have the 
> following

<scripts snipped>

> I get error when i run
> #perl main.pl
> Undefined subroutine &main::mysub called at scripts/doThis.pl line 4, 
> <STDIN> line 1.

When I tried your code, it didn't compile...  After a couple of 
corrections, I couldn't reproduce the error.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Tue, 3 Jan 2006 20:13:20 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: calling subroutine
Message-Id: <slrndrmbq0.2tg.tadmc@magna.augustmail.com>

Madhu Ramachandran <madhuram@nortel.com> wrote:


> unshift(@INC, "./scripts);
                ^
                ^ where's the other quote?


> I get error when i run
> #perl main.pl
> Undefined subroutine &main::mysub called at scripts/doThis.pl line 4, 


Funny, I get a different message when I run your program.


> would appreciate any help.


Would appreciate if you posted Real Perl Code.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Wed, 4 Jan 2006 12:08:55 +1300
From: "Tintin" <tintin@invalid.invalid>
Subject: Re: How to get image size in these conditions ?
Message-Id: <WtDuf.12214$vH5.616211@news.xtra.co.nz>


"BlinKol" <.@.> wrote in message
news:MPG.1e24ecf16b4b812e989729@news.tiscali.fr...
> How to get width and height of an image file (GIF or JPEG), knowing my
> hosting provider has just the Perl 5.00503 stock modules (i.e. without
> things like Image::Info or Image::Size) and doesn't allow any new module
> install out of my own cgi-bin directory ?

Well, just install Image::Size under your cgi-bin directory.  It's a very
simple module.




------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 8823
***************************************


home help back first fref pref prev next nref lref last post