On Oct 3, [EMAIL PROTECTED] said:
>I'm having a difficult time understanding the map function.
You're having a hard time coping with the fact that $_ is an alias to the
values in the list you're mapping over, not a copy.
>@new_names = map { ($x = $_) =~ s/(jpg|gif)$/html/i; $x } @old_names;
>
>
Hi all, the problem is that the script is really erroneous. Where you read
"q(..." should be "p( ..."
The p() function is a part of the CGI.pm modules and stands for a new
paragraph.
the right script is:
#!/usr/bin/perl -w
# cgi-bin/ice_cream: program to answer *and generate* ice cream
# favorite
Hey eric-perl,
My MUA believes you used
to write the following on Thursday, October 3, 2002 at 1:38:26 AM.
eppn> Every time I send a message to this list, I receive a message from
eppn> [EMAIL PROTECTED] immediately afterwards. It appears to be garbage
eppn> (lots of screwy character
I never get them.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 02, 2002 10:38 PM
To: Beginners Perl Mailing List
Subject: WHO IS [EMAIL PROTECTED] ???
Hello, All:
Every time I send a message to this list, I receive a message from
[EMA
I've never used CGI before, I know nothing about it. Offhand though, from
looking at your actual versus expected output (opened in new window ;) , I
have to wonder if the reason you get a literal "textfield("flavour","mint") is
because you have surrounded that statement in your code with a q()
Hello Nathanael and other guys,
> First of all, if possible, use the Llama 3rd, not 2nd.
It's not... :-(
> Second, can you give the expected output and the actual output.
I tried to send the pictures to this list but my e-mail was rejected as it
grew upon 5 bytes
In sumary, this script sh
I've never used CGI before, I know nothing about it. Offhand though, from
looking at your actual versus expected output, I have to wonder if the reason
you get a literal "textfield("flavour","mint") is because you have surrounded
that statement in your code with a q() structure. In other word
> On Thu, Oct 03, 2002 at 10:10:34AM -0700, Jessee Parker wrote:
> > At the top of the loop, I check the system uptime to get the load
average
> > so I can have the program sleep for 5 seconds to let things stabilize a
> > bit.
>
> I suspect an easier way of doing this would be to nice yourself do
Not necessarily prettier:
@new = map {m/(.*)(?:jpg|gif)$/i?"$1html":$_ } @old;
Karl Kaufman wrote:
>I, too, am interested in this syntax. I had to do the same juggling in order to
>"map" the values without affecting the original array -- and would prefer cleaner
>syntax if it's possible.
First of all, if possible, use the Llama 3rd, not 2nd.
Second, can you give the expected output and the actual output.
What platform are you on, what version of perl are you using, etc?
Nathanael
"Ain't no blood in my body, it's liquid soul in my veins"
~Roots Manuva
--
To unsubscribe, e-ma
I, too, am interested in this syntax. I had to do the same juggling in order to "map"
the values without affecting the original array -- and would prefer cleaner syntax if
it's possible. Thx! Karl
> @new_names = map { ($x = $_) =~ s/(jpg|gif)$/html/i; $x } @old_names;
>
> Is there a more el
On Thu, Oct 03, 2002 at 10:10:34AM -0700, Jessee Parker wrote:
> At the top of the loop, I check the system uptime to get the load average
> so I can have the program sleep for 5 seconds to let things stabilize a
> bit.
I suspect an easier way of doing this would be to nice yourself down really
l
On Thu, Oct 03, 2002 at 03:04:07PM -0400, Rob Das wrote:
> Is there a reasonable check for memory I can use to see what's available
> compared to the file size?
I don't know of a portable method for checking your memory. However, even
if there were a way, why would you want to go that route? I
- Original Message -
From: <[EMAIL PROTECTED]>
To: "Beginners Perl Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, October 03, 2002 1:31 AM
Subject: Using map
> Hello, All:
>
> I'm having a difficult time understanding the map function.
>
> I've got an array of file names that all end
Hi Eric,
if you want a more pretty way, (if a touch slower) try:
my @new_names = @old_names;
foreach (@new_names) { s/\.(jpg|gif)/\.html;i ; }
I personally don't like map as I came to PERL from C, but if you want to
use it instead...
my @new_names = @old_names;
map s/\.(jpg|gif)/\.html/i, @new
Hi all,
I'm studying the "Learning Perl Second Edition" and I'm learning cgi now.
The book presents a sample cgi that doesn't produces the expected result as
the book says it would.
Could someone test it and say to me if there is something wrong?
The following script was retired from the section
Hello, All:
Every time I send a message to this list, I receive a message from
[EMAIL PROTECTED] immediately afterwards. It appears to be garbage
(lots of screwy characters...).
Where is this coming from? Am I the only one receiving these?
--
Eric P.
Sunnyvale, CA
--
To unsubscribe, e-mai
Hello, All:
I'm having a difficult time understanding the map function.
I've got an array of file names that all end in 'jpg' or 'gif'. I'd like
to create a parallel array of file names that end in 'html'. I'm creating
the array this way...
@new_names = map { ($x = $_) =~ s/(jpg|gif)$/html/i;
Hey shawn,
My MUA believes you used Lotus Notes Release 5.0.8 June 18, 2001
to write the following on Friday, September 27, 2002 at 3:51:32 PM.
sgc> Is this a good magazine for someone interested in Perl, or just
sgc> for a hard-core user who uses it every day?
I would say it is both!
I have the file downloading fine using FTP. Now, I need to convert it from
(I believe) binary into ASCII characters. I've been looking at 'binmode'
and 'stat $filename', but I don't get a response from 'print "File is
binary.\n" if -B;' and the 'binmode HANDLE' results in getting no output if
I
Thanks for the suggestions. I found out that the user (my boss!) was trying
to use this for a really large file...
Is there a reasonable check for memory I can use to see what's available
compared to the file size?
Rob
-Original Message-
From: Gary Stainburn [mailto:[EMAIL PROTECTED]]
From: Bryan Harris <[EMAIL PROTECTED]>
> Is it possible to set the "hidden" attribute of a file on a Windows
> machine using perl?
use Win32::File;
GetAttributes( $filename, $attr);
SetAttributes( $filename, $attr | HIDDEN);
We fetch the attributes it has and add HIDDEN.
Hi ...
How do I open the .ezm files?
Thx
Anil
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 03, 2002 11:34 AM
Subject: beginners Digest 3 Oct 2002 18:34:05 - Issue 1177
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
Is it possible to set the "hidden" attribute of a file on a Windows machine
using perl?
TIA.
- Bryan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Does anyone know how do I use this function or another one to search a valid
value on a text file I have from a FORM submitted from an HTML, this value
is read from an array because the text file is a database which has all the
values sent to the array already mentioned.
Attached is the CGI to
I have a program that uses the Mail::Sender module that loops
through and gets the names and e-mail addresses out of a MySQL database. At
the top of the loop, I check the system uptime to get the load average so I
can have the program sleep for 5 seconds to let things stabilize a bit. When
On Thursday 03 Oct 2002 5:20 pm, Janek Schleicher wrote:
> Rob Das wrote at Thu, 03 Oct 2002 15:01:31 +0200:
> > Hi all:
> >
> > I have a script that is merging many files into a new file, by reading
> > one at a time and adding to the new one. The error I received was "Out of
> > memory during re
On Thu, Oct 03, 2002 at 04:23:19PM +0200, Jasper Wammes wrote:
> Hi there,
Hi,
> I am analizing a Squid proxy log file. The times is like this:
> 1033638320.833
> Hoe can i convert that to a normal time?
>
> Thanks for your time.
This should do it, to a certain extent:
my $number_time = 10336
Rob Das wrote at Thu, 03 Oct 2002 15:01:31 +0200:
> Hi all:
>
> I have a script that is merging many files into a new file, by reading one
> at a time and adding to the new one. The error I received was "Out of memory
> during request for 1016 bytes, total sbrk() is 1186891848 bytes!" (I did not
From: "Janfek Esquivel" <[EMAIL PROTECTED]>
> Does anyone know how do I set the print option to make a text appear
> in different colors? Thanks in advance.
Erm .. unless you tell us WHERE DO YOU PRINT IT TO we can't help.
Jenda
=== [EMAIL PROTECTED] == http://Jenda.Kr
On Thu, 3 Oct 2002, Janfek Esquivel wrote:
> Does anyone know how do I set the print option to make a text appear in
> different colors?
> Thanks in advance.
perldoc Term::ANSIColor
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Does anyone know how do I set the print option to make a text appear in
different colors?
Thanks in advance.
_
Send and receive Hotmail on your mobile device: http://mobile.msn.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
F
On Oct 3, Jasper Wammes said:
>I am analizing a Squid proxy log file. The times is like this:
>1033638320.833
>Hoe can i convert that to a normal time?
Well, if you don't mind the non-integer portion, 1033638320 represents Thu
Oct 3 05:45:20 2002.
Use localtime():
my @parts = localtime 1033
Jasper Wammes wrote:
> Hi there,
>
>
> I am analizing a Squid proxy log file. The times is like this:
> 1033638320.833
> Hoe can i convert that to a normal time?
>
> Thanks for your time.
>
>
> Greetings
>
>
I think you can afford to ignore the fraction of the second
So use
@time_array
> -Original Message-
> From: Jasper Wammes [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 03, 2002 10:23 AM
> To: [EMAIL PROTECTED]
> Subject: SQUID Log Unix time
>
>
> Hi there,
>
>
> I am analizing a Squid proxy log file.
We really don't need to know about your private life.
Hi there,
I am analizing a Squid proxy log file. The times is like this:
1033638320.833
Hoe can i convert that to a normal time?
Thanks for your time.
Greetings
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Is there a Perl module which can be used to download files from an AS/400?
We are currently using Rumba software, and we don't want to install it on
the machine which we want to use for this project.
The Rumba software allows us to create a .rto file, which tells the program
the exact format we n
On 3 Oct 2002, chad kellerman wrote:
> Hi everyone,
>
> What would be the easiest way to find the uptime of a linux
> machine? I don't want to use a system call. Is there a module I can
> use? Or do I have to open /proc/uptime and calculate it thru there?
>
Prase the output of the command
Hi everyone,
What would be the easiest way to find the uptime of a linux
machine? I don't want to use a system call. Is there a module I can
use? Or do I have to open /proc/uptime and calculate it thru there?
Thanks for the help..
Chad
--
Chad Kellerman
Jr. Systems Administrator
Alaban
Hi all:
I have a script that is merging many files into a new file, by reading one
at a time and adding to the new one. The error I received was "Out of memory
during request for 1016 bytes, total sbrk() is 1186891848 bytes!" (I did not
add the "!"...). This is on a Sun box with 4 Gig, typically
A PIX only allows telnet to the "inside" interface and you have to be
listed as a trusted host (telhet ]. Can you telnet i ok
yourself from that machine?
If that's all ok, I would guess it's a problem with Prompt. Net::Telnet
uses a pattern match to determine if it's time to send data, so whe
NAME
beginners-faq - FAQ for the beginners mailing list
1 - Administriva
1.1 - I'm not subscribed - how do I subscribe?
Send mail to <[EMAIL PROTECTED]>
You can also specify your subscription email address by sending email to
(assuming [EMAIL PROTECTED] is your email address)
hi,while "make" perl says the following:
make[1]: Leaving directory `/static/perl-5.8.0/x2p'
Making B (dynamic)
Can't figure out your cwd! at ../../lib/ExtUtils/MakeMaker.pm line 229.
Warning: No Makefile!
make[1]: Entering directory `/static/perl-5.8.0/ext/B'
make[1]: *** No rule to m
From: "Davide Copelli" <[EMAIL PROTECTED]>
> I need to execute this query and change the name of the table
>
> $table1 = 'tab1';
> $table2 = 'tab2';
> $data1 = 'a';
> $data2 = 'b';
>
> my $sth = $dbh->prepare(qq|SELECT count(id) FROM ? WHERE data1=? |);
>
> $sth->execute( $tab
T Kidwai wrote:
>
> hello everybody,
Hello,
> i needed some help with the diamond operator (<>)
> i am trying to use it in a while like so:
>
> while(<>){}
This reads all the lines from all the files listed in @ARGV and does
nothing with them.
> @somearray = reverse(@ARGV);
This reverses t
We have one log file which are referred by some perl scripts at two locations
initially we need to get the log file from location A and append our logs
to it at Location B , our changes + original Location A logs+ Location A's
appended logs + Location B's changes log at Location B needs to be
I need to execute this query and change the name of the table
$table1 = 'tab1';
$table2 = 'tab2';
$data1 = 'a';
$data2 = 'b';
my $sth = $dbh->prepare(qq|SELECT count(id) FROM ? WHERE data1=? |);
$sth->execute( $table1,$field1 );
$total1=$sth->fetchrow_array();
$sth->execute( $table2,$field2 );
hello everybody,
i needed some help with the diamond operator (<>)
i am trying to use it in a while like so:
while(<>){}
@somearray = reverse(@ARGV);
printf("@somearray");
i run the perlscript with a file suffix like:
./perlscript test1.txt
i am trying to reverse the contents of test1.txt line-b
Hi,
I am a new perl user. I have problem telnet to Cisco
PIX Firewall. Following is my testing perl script. I
used net::telnet::cisco module telnet to Cisco routers
or switches no problem. But, Cisco PIX Firewall not
working. Please give me some advises.
use Net::Telnet::Cisco;
use strict;
m
49 matches
Mail list logo