is this:
Undefined subroutine main::some_routine_name called at script_name line
XXX
TIA
If they are miscodings then not really, mostly because Perl allows you
to choose subroutines/methods at runtime. So the interpreter can't know
a pri ori what subs need to exist. If you need to check for a sub
Hello,
occasionally we get this error, due to a mis coding error or type-O error, but
was wondering is there away to check, with a perl code, to make sure the sub
routine exists before displaying this system 500 internal error message. the
error I'm referring too is this:
Undefined subroutine
Hi All,
I apologise for the newbie question straight off - I don't have my
Camel book with me to consult.
Why does the following give me an error?:
--
#!/usr/bin/perl -w
#
# A script that gets a list of technologies that have events on
Display layer.
#
use strict;
sub q_db
what is param.?
If it's a variable, and not declared, qualify it using my or local.
Else, if it's a string that you want pass to the function, use single
quotes.
-Prasanna
Tielman Koekemoer (TNE) wrote:
Hi All,
I apologise for the newbie question straight off - I don't have my
Camel book with me
Thanks Prasanna, that fixed it.
-Original Message-
From: Prasanna Kothari [mailto:[EMAIL PROTECTED]
Sent: 06 May 2005 02:26 PM
To: beginners@perl.org
Cc: Tielman Koekemoer (TNE)
Subject: Re: Calling a subroutine - strict very strict
what is param.?
If it's a variable, and not declared
Maybe I should tell you what fixed it:
The param was a string so enclosed it in single quotes.
Thanks!
-Original Message-
From: Tielman Koekemoer (TNE) [mailto:[EMAIL PROTECTED]
Sent: 06 May 2005 02:33 PM
To: [EMAIL PROTECTED]; beginners@perl.org
Subject: RE: Calling a subroutine
Hello,
I have an array and I would like to pass it to a subroutine:
printlist([EMAIL PROTECTED]);
sub printlist
{
my $array_ref = (shift);
my $max;
my $maxnew = @{$array_ref};
for(my $i=0;$i $maxnew; $i++){
print \t\t\t\t\t
Michael Gale mailto:[EMAIL PROTECTED] wrote:
: I am passing the reference of an to the subroutine, which using
: (shift) assigns the first scaler to my scaler array_ref. So now
: array_ref scaler is equal to the passed scaler allowing me to use
: array_ref as a reference.
:
: Correct ?
Yes
On Sat, 12 Mar 2005 21:54:23 -0500, DBSMITH wrote:
All,
Please audit my code as I cannot figure out the correct method to pass by
ref into my logroll subroutine.
Here is the error I am getting :
Uncaught exception from user code:
error: can not lock open: ($_) at
I haven't
All,
Please audit my code as I cannot figure out the correct method to pass by
ref into my logroll subroutine.
Here is the error I am getting :
Uncaught exception from user code:
error: can not lock open: ($_) at
/usr/local/bin/ohiohealth/tapesz_chk.OH.pl line 115
Carp::croak
Chris wrote:
Greetings,
I don't know what the proper terminology is for what I want to do, so if
somebody can tell me what it is, that would be great.
Basically I have my core code, then lots of subroutines. Right now I pass data
to subroutines via a parameter hash. How can I pass an object
If you are only looking for the terminology, this is called 'Pass by Reference':
http://www.perlpod.com/5.8.4/pod/perlsub.html#Pass%20by%20Reference
On Sun, 20 Feb 2005 02:30:34 -0500, Chris [EMAIL PROTECTED] wrote:
Greetings,
I don't know what the proper terminology is for what I want to
Dear all,
I haven't coded anything yet, but I was wondering if it has been done, or
can be done to write a small sub that can be called to show how a script
is progressing?
Like an on the sopt 1% 2% kind of thing or a hash progress?
A small pointer to the correct feature/doc is all I am
you can use the perl debugger for that.
see
perldoc perldebug
-Original Message-
From: Gavin Henry [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 02, 2005 5:36 PM
To: beginners@perl.org
Subject: Subroutine for a scripts progress
Dear all,
I haven't coded anything yet, but I
PM
To: beginners@perl.org
Subject: Subroutine for a scripts progress
Dear all,
I haven't coded anything yet, but I was wondering if it has been done, or
can be done to write a small sub that can be called to show how a script
is progressing?
Like an on the sopt 1% 2% kind of thing
quote who=Gavin Henry
Dear all,
I haven't coded anything yet, but I was wondering if it has been done, or
can be done to write a small sub that can be called to show how a script
is progressing?
Like an on the sopt 1% 2% kind of thing or a hash progress?
A small pointer to the
Hi I am using a perl module in which I have used some routines.
and when I complile the script with
perl -w .pm
I get these errors( like routine redefined)
Subroutine ExpiryMessage redefined at **.pm line 1200.
Subroutine InstructorExpiryMessage redefined at ***.pm line 2454.
Subroutine
Developer
Wild Technology Pty Ltd
-Original Message-
From: Anish Kumar K. [mailto:[EMAIL PROTECTED]
Sent: Monday, 31 January 2005 7:42 PM
To: beginners perl
Subject: Subroutine redefined at ***.pm error
Hi I am using a perl module in which I have used some routines.
and when I
presenting anything
on the new page. And nothing goes in Apache 'error.log'.
The script contained what I'm going to call an in-line subroutine (for
sorting, surprise, surprise). If that sub is moved down to the end of the
script after the final 'exit 0', everything works.
Any explanations occur
I have a program that generates a random number between 1 and 6. based on
the outcome I want to run a subroutine that corresponds to the result.
i.e if the result is 1 then the program should run sub F1. my question is
how can I dynamically call the subroutine.
i tried this but obviously
On Tue, 18 Jan 2005 20:05:01 +0200, Absolut Newbie
[EMAIL PROTECTED] wrote:
$var1(); # this is where it crashes
You're looking for the eval command, which will read a string and
evaluate the code it contains. ie:
eval ( $var1() );
On on the other hand, you could do this with if statements.
I have a program that generates a random number between 1 and 6. based on
the outcome I want to run a subroutine that corresponds to the result.
i.e if the result is 1 then the program should run sub F1. my question is
how can I dynamically call the subroutine.
i tried this but obviously
Absolut Newbie wrote:
I have a program that generates a random number between 1 and 6.
based on the outcome I want to run a subroutine that corresponds to
the result. i.e if the result is 1 then the program should run sub
F1. my question is how can I dynamically call the subroutine.
i tried
- Original Message -
From: Stone
To: beginners@perl.org
Sent: Tuesday, January 18, 2005 12:20 PM
Subject: Re: dynamically calling a subroutine
On Tue, 18 Jan 2005 20:05:01 +0200, Absolut Newbie
[EMAIL PROTECTED] wrote:
$var1(); # this is where it crashes
You're
Absolut Newbie wrote:
I have a program that generates a random number between 1 and 6. based on
the outcome I want to run a subroutine that corresponds to the result.
i.e if the result is 1 then the program should run sub F1. my question is
how can I dynamically call the subroutine.
i tried
Absolut Newbie wrote:
I have a program that generates a random number between 1 and 6. based on
the outcome I want to run a subroutine that corresponds to the result.
i.e if the result is 1 then the program should run sub F1. my question is
how can I dynamically call the subroutine.
i tried
I have written a rather simplistic script so I can get used to
LWP::Simple etc... Anyway I am using a subroutine to get and print
data from a website. I have gotten it to work except for the fact that
the first iteration of the subroutine uses no data at all, yet after
that it works fine
Dear Mike,
Surprised you've been stumped for 3 hours, but sometimes the
most obvious bugs are the hardest to find. In your code you have:
...
printSequence;
foreach my $id (@list) {
...
That function call is causing your problem.
Jonathan Paton
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
On Nov 25, Zeng Nan said:
1 my @nums = (1..100);
2 my $result = total(@nums);
3
4 print $result\n;
5
6 sub total {
7 my $sum;
8 foreach(@_){ $sum += $_ }
9 $sum;
10 }
My question is without line 9, the return value is nothing, while I
expect it will return the value of $sum, as it is the
Hi,
Here is a simple program:
1 my @nums = (1..100);
2 my $result = total(@nums);
3
4 print $result\n;
5
6 sub total {
7 my $sum;
8 foreach(@_){ $sum += $_ }
9 $sum;
10 }
My question is without line 9, the return value is nothing, while I
expect it will return the value of $sum, as it
Zeng Nan [ZN], on Thursday, November 25, 2004 at 16:04 (+0800) typed
the following:
6 sub total {
7 my $sum;
8 foreach(@_){ $sum += $_ }
9 $sum;
10 }
ZN My question is without line 9, the return value is nothing, while I
ZN expect it will return the value of $sum, as it is the last
Zeng Nan wrote:
Hi,
Here is a simple program:
1 my @nums = (1..100);
2 my $result = total(@nums);
3
4 print $result\n;
5
6 sub total {
7 my $sum;
8 foreach(@_){ $sum += $_ }
9 $sum;
10 }
My question is without line 9, the return value is nothing, while I
expect it will return the value
.
my_script q should call the sub routine zzzq,
my_script e should call the sub routine zzze,
...
when there are many sub routines,
if i get the name of subroutine as
$name = zzz.$argument_received;
can I call the sub routine as
abc::$name;
This does not work.
Any suggestion, to get this done
TapasranjanMohapatra [EMAIL PROTECTED] wrote:
: Suppose I have many sub routines in a module abc.pm
:
: package abc;
:
: sub zzzq
: {
: }
:
: sub zzze
: {
: }
: sub zzzr
: {
: }
:
: Now I use this module in another script. I want to call the
: sub routines, as suggested by the argument passed
to call the sub routines, as suggested by the argument passed to the script.
i.e.
my_script q should call the sub routine zzzq,
my_script e should call the sub routine zzze,
...
when there are many sub routines,
if i get the name of subroutine as
$name = zzz.$argument_received;
can I call the sub
Charles K. Clarkson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
TapasranjanMohapatra [EMAIL PROTECTED] wrote:
: Suppose I have many sub routines in a module abc.pm
:
: package abc;
:
: sub zzzq
: {
: }
:
: sub zzze
: {
: }
: sub zzzr
: {
: }
:
: Now I use this
there are many sub routines,
if i get the name of subroutine as
$name = zzz.$argument_received;
can I call the sub routine as
abc::$name;
This does not work.
Any suggestion, to get this done?
I'm guessing that your primary mission objective is to parse one of
several commands at run-time
John W. Krahn wrote:
Gunnar Hjalmarsson wrote:
Here the loop is finished, but nothing is returned from the
subroutine.
return @basenames;
Actually, something IS returned, it is just not something that the OP
expects or wants.
Yeah, I suppose it returns the null-string. Thanks for the correction
the subroutine to look like the
following:
filename
filename
filename
filename
filename
filename
filename
filename
filename
filename
framename
framename
framename
framename
framename
framename
shotname
shotname
shotname
shotname
shotname
basename
basename
basename
basename
assigns to @basenames the extracted basename from the last
path only, i.e. the basenames extracted during previous iterations are
not kept. You probably mean:
push @basenames, $1;
}
}
Here the loop is finished, but nothing is returned from the subroutine.
return @basenames
separated, but programmers sure do. For instance, do
you mean for the array @basenames inside the subroutine to be the same
as the array @basenames that you declared outside the subroutine? If
so, why are you trying to assign a value to it when it's already
(theoretically) being populated inside
, i.e. the basenames extracted during previous iterations are
not kept. You probably mean:
push @basenames, $1;
}
}
Here the loop is finished, but nothing is returned from the subroutine.
return @basenames;
Actually, something IS returned, it is just not something that the OP
\shots\sp2\shot_1\sub_directory\basename.0009.rgb
C:\Perl\scripts\shots\sp2\shot_1\sub_directory\basename.0010.rgb
I want my output from the subroutine to look like the
following:
filename
filename
filename
[snip]
basename
basename
basename
The following is the code:
#!/usr/bin/perl -w
use strict;
my
# send an email with @email_list
# store to a database with @db_list
Now your sub is generic, it doesn't rely on the specific names, @pics
and $website, and doesn't cause data to be printed when you might not
want it to. Obviously this is a contrived example but as things get
more complex
the subroutine like links; but I want to put the
result into a variable in order to stick it into an e-mail. I have been
trying all day reading all my perl books and it's time to ask for help.
Thanks.
--
Just getting into the best language ever...
Fancy a [EMAIL PROTECTED] Just ask
the subroutine like links; but I want to put the
result into a variable in order to stick it into an e-mail. I have been
trying all day reading all my perl books and it's time to ask for help.
Note that we don't want to call Clinks that is better written as
Clinks().
What is the result? In your case
this subroutine into any Perl
program in the world and know that we wouldn't mess up that program's $a
and $b (if any).[109]
-
--
Just getting into the best language ever...
Fancy a [EMAIL PROTECTED] Just ask!!!
--
To unsubscribe, e-mail: [EMAIL PROTECTED
;
}
Doesn't this still get the scalar and array from what I defined at the top?
Also, why do you assign them to @_, can't we use that when iterating @list?
Why wouldn't it accept it's arguments?
-
I would normally call the subroutine like links; but I want to put the
result
the calling syntax has to be different (see summary below).
Also, why do you assign them to @_, can't we use that when iterating
@list?
I am not assigning them *to* @_, but *from* @_. In other words, when the
subroutine is called it automatically stuffs the arguments given
IT
UNIX / TSM / EDM Teams
614-566-4145
Chris Devers [EMAIL PROTECTED]
09/16/2004 04:59 PM
Please respond to Perl Beginners List
To: [EMAIL PROTECTED]
cc: Perl Beginners List [EMAIL PROTECTED]
Subject:Re: Net ::FTP and subroutine calls
On Wed, 15 Sep 2004
On Fri, 17 Sep 2004 [EMAIL PROTECTED] wrote:
Right thanks forgot about that! So how do I out this failed info to
STDOUT (ftplog), b/c if it does fail I would want to know!
First things first: does the version I sent yesterday work? Focus on
getting the FTP transaction to finish
[EMAIL PROTECTED]
Subject:Re: Net ::FTP and subroutine calls
On Fri, 17 Sep 2004 [EMAIL PROTECTED] wrote:
Right thanks forgot about that! So how do I out this failed info to
STDOUT (ftplog), b/c if it does fail I would want to know!
First things first: does the version I
On Fri, 17 Sep 2004 [EMAIL PROTECTED] wrote:
yes my ftp code has always worked, so lets move on!
Ok -- you didn't actually say that, you just said things don't work.
The way you're using the die statement won't work.
Go back to the docs and usual manuals to look for other ways to do this.
DBSMITH at OhioHealth.com writes:
..snip..
I'm fairly new to Perl, but have been working on a similar typ problem and
monitoring the success of my Net::FTP session. I used logic similarm to the
following:
my ftp;
if($ftp = Net::FTP-new($remotehost)) {
print Initial FTP successful\n;
} else
On Wed, 15 Sep 2004 [EMAIL PROTECTED] wrote:
no nothing is showing up in the file.
Okay then, so this logging code is all hand-written ?
It seems then that nothing in this script is actually writing to the log
file you've asked for, because there's no such thing as $ftp-$ftplog
(or
($data) or die FTP put to IrMt failed,
$ftp-$ftplog;
$ftp-quit;
}
and I want to append the result data to my log file. I ran it and the
files was 0 bytes. What am I doing wrong?
Also, how and what do I use to call a subroutine block that is in another
file from my MAIN
the Net::FTP docs specifically recomment this kind of code.
Also, how and what do I use to call a subroutine block that is in
another file from my MAIN Perl program? Will you please provide a
code example?
The best way to do it is to make a package out of your subroutine (see
the usual
to Perl Beginners List
To: [EMAIL PROTECTED]
cc: Perl Beginners List [EMAIL PROTECTED]
Subject:Re: Net ::FTP and subroutine calls
On Wed, 15 Sep 2004 [EMAIL PROTECTED] wrote:
The Python folks are right -- whitespace is your friend! Use it!
sub
On Wed, 15 Sep 2004 [EMAIL PROTECTED] wrote:
no nothing is showing up in the file. Here is where I looked for
information on Net::FTP
http://search.cpan.org/~gbarr/libnet-1.19/Net/libnetFAQ.pod
ok I will look in perldoc -f package. Is there a better place though?
If you're
. Conceptionally this looks like this:
FooModule.pm:
package FooModule;
sub usedLater;
sub theFunctionCalledFromoutside{
...
...
usedLater( $argument );
}
sub usedLater{
[... some code ...]
}
1;
The call
usedLater( $argument );
leads to this errror
Undefined subroutine FooModule
From: Schlabach, Torsten [EMAIL PROTECTED]
I have a CGI script that is calling a perl module. One function in
that module uses a sub which is defined only later in the source, but
there is a forward declaration available for the function with sub.
Conceptionally this looks like this:
);
leads to this errror
Undefined subroutine FooModule::usedLater called at ...
Any idea where to search? This is code I did not write myself and
others have reported it worked for them unter Perl 5.8.1. I have
5.8.0. I also tried with 5.8.5, but got the same error, so this does
not look
Well, it's not really MY code, but I will attach it.
It is line 103 that breaks! (The call to genDialog.)
Torsten
-Ursprüngliche Nachricht-
Von: Jenda Krynicky [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 13. September 2004 18:47
An: '[EMAIL PROTECTED]'
Betreff: Re: Undefined subroutine
Nachricht-
Von: Bob Showalter [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 13. September 2004 18:50
An: 'Schlabach, Torsten'; '[EMAIL PROTECTED]'
Betreff: RE: Undefined subroutine [...] called at [...] though sub and rou tine exist
Schlabach, Torsten wrote:
Dear list,
I have a problem
Hi,
I would like to know which of this
is better and what is the pro and cons:
1. A file mysub.pl which stored
a subroutine, and later called by
main file using: do mysub.pl
or
2. A file mysub.pm and called
in main file using : use mysub.pm
Thanks so much for your time
Regards,
Edward WIJAYA
Edward Wijaya wrote:
Hi,
I would like to know which of this
is better and what is the pro and cons:
1. A file mysub.pl which stored
a subroutine, and later called by
main file using: do mysub.pl
or
2. A file mysub.pm and called
in main file using : use mysub.pm
The second
Hi,
I have a subroutine that take 2 arrays as argument.
I dont' know how to construct it?
sub mysub{
my (@array1, @array2) = @_; # is this correct? How do I do it?
#process @array1
#process @array2 etc
return @array3;
}
Please advice.
Thanks so much for your time.
Regards
go through perldoc perlref
With Best regards,
R. Kamal Raj Guptha.
-Original Message-
From: Edward Wijaya [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 05, 2004 3:37 PM
To: [EMAIL PROTECTED]
Subject: How to pass two arrays as arg in a subroutine?
Hi,
I have a subroutine that take 2
Have them pass the arrays as a reference. For example:
@array1 = (1, 2, 3, 4, 5);
@array2 = (6, 7, 8, 9, 10);
mysub([EMAIL PROTECTED],[EMAIL PROTECTED]);
sub mysub{
my ($array1, $array2) = @_;
#process @{$array1}
#process @{$array2} etc
return @array3;
}
Look into
Thanks so much Kamal,
your explanation is very clear and complete.
It works now.
I learnt a great deal from it.
Regards
Edward WIJAYA
Hope this is useful for you.
For more on references go through perldoc perlref
With Best regards,
R. Kamal Raj Guptha.
--
To unsubscribe, e-mail: [EMAIL
I am using an application called Title to kick off jobs instead of using the cron.
I am told that this application doesn't accept SQL embedded inside perl scripts unless
the SQL or perl script returns the end of file message. What method in perl returns
the eof message?
is it
sub myroutine
Thanks all for the feedback on the WARNING message that I am getting. I know that I
can turn warning off at that moment of code, but I want to know for my own knowledge
what is the warning all about. So, here is the entire sub routine. NOTE** I declared
@records as a global earlier..
JC
sub
sub data_collect {unless (open(OUTFILE,$fourdayreport))
{die open(ERRORLOG, $errorlog)
print ERRORLOG Sorry file $dayreport couldn't be created\n; return
Failed;}
else{
while( @record = $sth-fetchrow_array() )
{
# no warnings;
#INSERTED :::
#Since you are not
I used ---print OUTFILE join(,,@record), \n;--- that you suggested and still got
the error.
sub data_collect {unless (open(OUTFILE,$fourdayreport))
{die open(ERRORLOG, $errorlog)
print ERRORLOG Sorry file $dayreport couldn't be created\n; return Failed;}
else{
while(
What about manually stepping through the array elements?
That is:
for ( my $i = 0; $i $#record; $i++) {
print $record[$i],;
}
print $record[$#record]\n;
__
William Ampeh (x3939)
Federal Reserve Board
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
What about manually stepping through the array elements?
That is:
for ( my $i = 0; $i $#record; $i++) {
print $record[$i],;
}
print $record[$#record]\n;
__
William Ampeh (x3939)
Federal Reserve Board
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
Here is what I am doing. I shortend the sub, using local variables, and simplifying
the whole thing to just print to screen. I use your loop once I collect the records
into the @record variable and join them with ,...
Still to no avail, that menacing warning stays.
Thanks.
my $sql=qq(
Use of uninitialized value in concatenation (.) or string at select_c.pl line 70
and error
Use of uninitialized value in join or string at select_c.pl line 65.
are whats showing up
[EMAIL PROTECTED] wrote:
What about manually stepping through the array elements?
That is:
for ( my $i = 0;
$recordlist=join(,,@record); #This statement is causing the problem
Have you tried to see if there are any blank records in @record?
__
William Ampeh (x3939)
Federal Reserve Board
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
jason corbett wrote:
Here is what I am doing. I shortend the sub, using local variables,
and simplifying the whole thing to just print to screen. I use your
loop once I collect the records into the @record variable and join
them with ,...
Still to no avail, that menacing warning stays.
I have seen null values come up, but when I do this same query in SQL Plus (Oracle
environment BTW), I am getting no null values.
Ed Christian [EMAIL PROTECTED] wrote:jason corbett wrote:
Here is what I am doing. I shortend the sub, using local variables,
and simplifying the whole thing to
Hi all,
Does anyone know how can I do something like:
my $mod = Module.pm;
#Then require this $mod module (using eval()
#Then executing a certain subroutine from that module and getting the results.
I found that I can require a module and execute it entirely but I am not able to
choose
Octavian Rasnita wrote:
Does anyone know how can I do something like:
my $mod = Module.pm;
#Then require this $mod module (using eval()
#Then executing a certain subroutine from that module and getting
the results.
I found that I can require a module and execute it entirely but I
am not able
HI ,
You need to declare @array as my @array after line 14 in subroutine.
13 sub color {
14 $map1 = shift;
#NEW LINE- my @array ;
15 foreach $item(keys %$map1)
16 { push @array, $item;}
17 return [EMAIL PROTECTED];
18}
Regards
Thank you very much.That did work. A prime example of how painful being
a newbie can be :)
Ahmer
-Original Message-
From: Amit Kulkarni [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 17, 2004 11:07 PM
To: [EMAIL PROTECTED]
Subject: Re: Subroutine return values mixed.
HI ,
You need
Hi, I'm very new to Perl and am learning as I go along. I've been
reading a lot of articles and perl books to enhance my expertise. I'm
stuck on a problem where the content of the arrays returned back from a
common subroutine call are getting mixed up.
Here is the code
I encounter a very strange problem with interactions between main program
and several modules.
If there is no interaction between modules (module1 calling module2 and
module2 calling module1) there is no problem with any sub each module.
But if the mod1 uses 'use mod2' and mod2 uses 'use
I've created a subrutine to acces DB, but while sending the Query it get an
error.
My function looks like:
sub DbSqlQuery
{
local $str_query = @_ if @_;
print $str_query;
... blah, blah ..
}
And my program call it like:
... blah, blah ..
$str_Query = SELECT admin_ID, admin_name FROM
I've created a subrutine to acces DB, but while sending the Query it get an
error.
My function looks like:
sub DbSqlQuery
{
local $str_query = @_ if @_;
(Why are you using local? 'local' is deprecated in favor of 'my'.)
$str_query is a scalar, @_ is an array. Putting a scalar on
Ok, there's a few points I'd like to make.
read: perldoc perlvar AND perldoc perlsub
before continuing ;)
#1 local() is for perl's Variables, my() is for your variables.
#2 an array in scalar context evaluates to the number of elements in the
list, hence the 1.
I believe
);
I read in Perlsub that doing FindLink will pass the current @_ to the
subroutine. Great.
But I thought that doing FindLink(LinkID = $id); would not pass the
current @_ which is what I want. ie I only want to pass the param
LinkID not all the other stuff that was passed to the subroutine
to, so it's not going to look good, or
really do any good for anyone.
I read in Perlsub that doing FindLink will pass the current @_ to the
subroutine. Great.
But I thought that doing FindLink(LinkID = $id); would not pass the
current @_ which is what I want. ie I only want to pass the param
Angie Ahl wrote:
...
These subroutines are called externally ie
HLOM::Links-FindLink(LinkID = $id);
but also internally ie FindLink(LinkID = $id);
I read in Perlsub that doing FindLink will pass the current @_ to the
subroutine. Great.
Only if you omit the argument list as well
-FindLink(LinkID
= $id);
I have seen shift used in Subroutines like: NumberOfApples =
shift(@_);,
any reason for writing the subroutine that way?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
Thanks Will Bob.
using $class-FindLink(LinkID = $LinkID); has fixed it.
I needed to use it for every internal call to a subroutine within my
package and I'm now getting exactly what I needed.
For the archives purpose, use subroutine_name instead of
$class-subroutine_name passed
In a message dated 4/5/2004 11:25:56 AM Eastern Daylight Time,
[EMAIL PROTECTED] writes:
I have seen shift used in Subroutines like: NumberOfApples =
shift(@_);,
any reason for writing the subroutine that way?
You'll frequently see shift in subs. Like $class = shift; (Default for
shift
urvashi mishra wrote:
hi;
i am trying to take input from multiple files
Various I/P files are specified at command line...
What is an I/P file? Do you mean an input file?
Can anyone tell me how to pass the file name to a
routine that opens it for parsing
the same function is
R. Joseph Newton wrote:
Better not to use the newline at the end. You get more information if you just:
open(MIBFH,$file) or die Error opening the $file$!;
Should be:
open(MIBFH,$file) or die Error opening the $file: $!;
Sorry,
Joseph
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
Urvashi Mishra wrote:
hi;
Hello,
i am trying to take input from multiple files
Various I/P files are specified at command line...
Can anyone tell me how to pass the file name to a
routine that opens it for parsing
the same function is to be called for all the I/P
files...
hi;
i am trying to take input from multiple files
Various I/P files are specified at command line...
Can anyone tell me how to pass the file name to a
routine that opens it for parsing
the same function is to be called for all the I/P
files...
Code is:
foreach my $file (@ARGV)
{
601 - 700 of 1063 matches
Mail list logo