May i ask a question about reading file?
while(0){ print 'hi' }
Will never print hi.
cat 1.txt:
0
open FH, '1.txt' or die;
while() { print 'hi' }
This will print hi.
Since $_ == 0 here, why while become true?
I am confused about this.
Regards
November 20, 2022, 8:57 PM, "Kang-min Liu"
So this is what I have now in my library:
sub sumIt{
my $total;
$total += $_ for @_;
warn @_ was empty, total undefined!\n if !defined $total;
}
sub avg(@)
{
my @arr = @_;
my $arrSize = scalar(@arr);
#(last index). Double check;
return sumIt(@arr) / @arr;
}
1;
Why is
return sumIt(@arr)
Hello list!
On a sleepless Friday night/Saturday morning a question cam to mind and
I had to ask...
Assume I have a script that will run for 10 seconds.
Is it possible to have a function executed every 2 seconds?
I know it sounds weird but how would one go about something like that?
Hi all
This may be more appropriate in another perl forum, but I'll ask any
way.
I have two perl scripts, 1 running in the cgi-bin with a browser
and an email output and the email address to me at [EMAIL PROTECTED]
and this runs fine. I have another perl script running in another
folder(out side
Message-
From: Support
[mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 29, 2004 10:50 AM
To: [EMAIL PROTECTED]
Subject: Email problem
Hi all
This may be more appropriate in another perl forum, but I'll ask any
way.
I have two perl scripts, 1 running in the cgi-bin with a
browser
Hi all
I have a little bit of code you may be able to help with. I load a file
into an array with
foreach $lines(@database_array)
{
@edit_array
=
split(/\:/,$lines);
push(@member_array,[EMAIL PROTECTED]);
$x++;
}
#loop
and then play around with the array a bit, then I would like to
load it back
Hi
I do not want to continue this thread to bag other users, but I do have a
number or perl books and it did take me some time to find out how to clear
an array. From the replies I got (and I thank those who did reply)
confirmed I was using ' @array=()' correctly. In the end, I found the
Hi All
I have this little memory blockage again.
If I 'push' data from a database into an array to look/manipulate the data
and then using the same array name, 'push' data into the array from another
database, the data from the second DB file is added to the data of the
first. How can I clear
Hi All
I have a perl module I want to use in a perl script and make available by
the ' use mymodule.pm' call.
Plus I would like to place it the same directory as the main script. The
main script runs fine until I make a call to the module. I then then I
get a ' subroutine not defined '
What am I
At 08:15 a.m. 22/12/2003 -0800, you wrote:
On Dec 22, 2003, at 1:06 AM,
Support wrote:
Hi All
I have a perl module I want to use in a perl script and
make available by the ' use mymodule.pm'
call.
I'll presume you meant
use
mymodule; # don't need the *.pm
Yes
Plus
I would like to place
Thanks to all those who have replied
Just to update
This is the module call:
use Pcalc
qw(Delta_Days
Add_Delta_Days Date_to_Days leap_year
check_date);
this is the sub call:
$startdate =
Date_to_Days($tyear,$tmonth,$tday);
this is the error:
Undefined subroutine main::Date_to_Days called at
Thanks Dan
I've read the Exporter docs and the module seems to be OK there. I'm pretty
sure everything is OK with the module and the export/import functions.
Using 'strict' and 'warnings' is telling me:
'Use of uninitialized value in length at newcaldb.cgi line 165'
and I still sub error when I
Owen.
If you were standing next to me I'd give you a big kiss (no I'm not really
like that, just a figure of speech) It worked, how, why I'm still not sure.
I did put the module into a subdirectory and called it Date and used the
following.
use Date::Pcalc qw(Delta_Days Add_Delta_Days
Thanks to all those who replied.
I ended up doing some research myself and found a good date module at
http://search.cpan.org/author/STBEY/Date-Pcalc-1.2
for those who are interested in juggling dates. Its called Date::Pcalc
Cheers
Colin
Hi All
Just require a memory nudge again. I'm looking for a small script to count
the number of days between two dates. Date format is dd/mm/
Cheers
Colin
---
www.rentmyplace.co.nz
The ultimate in
Thanks to all who responded about setting pic sizes on a perl generated
html page.
It just needed a few nudges to remove the memory block.
A great forum everyone, keep it up
Regards
Colin
---
Hi All
I'm using perl to write a html page on the fly which includes photos of
different sizes. Does anyone know of a bit of code that I can add to my
script that ensures the resulting page shows the pictures on the page all
the same size regardless of the original picture size.
Cheer
Colin
.
push @{$xcp_request-{attributes}-{nameserver_list}
or this
$xcp_request-{attributes}-{contact_set}-{$contact_type}-{$contact_ke
y} = $in{$key};
1000 thank-yous
Scott Lutz
Pacific Online Support
Phone: 604.638.6010
Fax: 604.638.6020
Toll Free: 1.877.503.9870
http://www.paconline.net
Hello,
Can anyone help me to identify where the problem is in the below
code.
=
Error Msg : Not enough space at 1.pl line 2.
=
#!c:/iperl/cgi-bin/perl.exe
open (FHAN,
Hi All,
Can any one suggest me a link to online CGI-Perl Book.
Thanks
SureshA
[EMAIL PROTECTED]
===
The cause of evil is our desire to be superior to others and our
selfishness.
Hi All,
[Sat Oct 6 16:56:59 2001] abn.pl: Not enough space at abn.pl line 6
What is the error all about?
Thanks
Suresh
-- Forwarded message --
Date: Fri, 7 Sep 2001 02:37:33 +0530 (GMT)
From: Suresh Babu.A [Support] [EMAIL PROTECTED]
To: brian d foy [EMAIL PROTECTED]
Cc
Hi All,
I am unable to open the file, using the below mentioned code.
open (FHTML,Z:\\amro\\log\\va.txt) || die (Can't Open the File);
Web Server : Apache
OS : Windows 95
The file va.txt is having full permission (rwx for all).
Thanks in advance.
Thanks
SureshA
[EMAIL PROTECTED]
Hi Brain,
When i tried $!, i got the below error
[Sat Oct 6 16:56:59 2001] abn.pl: Can't Open the File.
[Sat Oct 6 16:56:59 2001] abn.pl: Not enough space at abn.pl line 6
for the code
$lfile=Z:\\amro\\log\\sar\\pa.txt;
open (FHTML, $lfile) || die (Can't Open the File.\n$!);
But when i
Dear All,
I have problem in opening the file and closing it in the below mentioned
script. Kindly help me to fix it.
Thanks in advance.
Thanks
Suresh A.
#!/usr/local/bin/perl -w
$shipdir=/databin/OUTGOING/SHIPMENT/bis/suresh;
$custdir=/uhome/cachet/temp/temp1/cust/;
Hi,
Any free links for Perl regular expressions, kindly provide me !!!
Thanks
SureshA
[EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Ladies and Gentlemen,
I am executing a script from the client, which should internally call a
script of a remote server and i have to pass argument from the client. Any
help regarding this is much appreticated.
Thank you very much for your time.
SureshA
[EMAIL PROTECTED]
26 matches
Mail list logo