[16908] in Perl-Users-Digest
Perl-Users Digest, Issue: 4320 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 14 03:06:29 2000
Date: Thu, 14 Sep 2000 00:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <968915111-v9-i4320@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 14 Sep 2000 Volume: 9 Number: 4320
Today's topics:
Re: Apache/perl cgi-bin question ? <philipg@atl.mediaone.net>
Re: Apache/perl cgi-bin question ? (Tim Hammerquist)
Re: CGI.pm with explorer 5.0 (newbie question) (Tim Hammerquist)
Re: Character Class in Regex - Despecify What? <e.roselli@volusoft.com>
Re: cross-platform archive mgt <elephant@squirrelgroup.com>
Re: Finding maximum length <elephant@squirrelgroup.com>
Re: Finding maximum length <elephant@squirrelgroup.com>
Getting File stats on a remote file (Haazi2)
Re: golf (Was Re: transliterating file names in a dir) (Abigail)
Re: golf (Was Re: transliterating file names in a dir) (Abigail)
Re: how to remove unprintable chars with Perl script <elephant@squirrelgroup.com>
How to use regular expression with GB code in Perl? <c8133594@comp.polyu.edu.hk>
Re: I really need help !!!! <peterp100@hotmail.com>
Re: killfiles? scores? I wish I had these luxuries <elephant@squirrelgroup.com>
print and CGI scripts <david.obrien@ssmb.com.au>
Re: print and CGI scripts <godzilla@stomp.stomp.tokyo>
Re: print and CGI scripts <david.obrien@ssmb.com.au>
Re: print and CGI scripts <godzilla@stomp.stomp.tokyo>
Re: Req.: The perfect Perl Editor? (Tim Hammerquist)
Re: Returning values of unticked checkbox <lr@hpl.hp.com>
Re: Silly grep tricks <lr@hpl.hp.com>
Re: slick way to look at array? <lr@hpl.hp.com>
SYSTEM calls within perl script michaelgartlan@my-deja.com
Re: SYSTEM calls within perl script <david.obrien@ssmb.com.au>
Re: Teaching Perl <e.roselli@volusoft.com>
Working with IP addresses the_crowbar@my-deja.com
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 14 Sep 2000 05:04:05 GMT
From: "Philip Garrett" <philipg@atl.mediaone.net>
Subject: Re: Apache/perl cgi-bin question ?
Message-Id: <9%Yv5.3427$IV1.1248937@typhoon.southeast.rr.com>
peter <peterp100@hotmail.com> wrote in message
news:rsf0sso5vfh8q8k5v94ku9b4tisof7sj9h@4ax.com...
> I want to place my perl cgi files in the same dir as my html files.
>
> How do I do set up permissions to do this ?
>
> I'm using Mandrake 7.1.
You probably want the <Files> directive, but this is the wrong newsgroup for
that.
Try comp.infosystems.www.servers.unix, according to the Apache FAQ.
------------------------------
Date: Thu, 14 Sep 2000 06:22:10 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: Apache/perl cgi-bin question ?
Message-Id: <slrn8s0sch.4t8.tim@degree.ath.cx>
peter <peterp100@hotmail.com> wrote:
> I want to place my perl cgi files in the same dir as my html files.
> How do I do set up permissions to do this ?
First, I'm obligated to tell you: this is strictly an Apache Q. But due
to the fact that over 80% of most cgi-bin's are mainly Perl scripts...
There's a little Apache directive (probably included in the sample
httpd.conf file that came with the server (/home/httpd/conf/httpd.conf
on mine). It looks like this:
AddHandler cgi-script .cgi
It may be .pl instead of .cgi, or maybe even a comma separated list of
extensions.
Now, whenever a client requests a file that ends in .cgi (or possibly
even filename.cgi.other_extension), Apache will execute it as a CGI
script. I don't recommend this, as you allow any clients to place CGI
scripts in directories that may not be approved...but I leave system
security issues up to you.
--
-Tim Hammerquist <timmy@cpan.org>
Education without values, as useful as it is,
seems rather to make man a more clever devil.
-- C.S. Lewis
------------------------------
Date: Thu, 14 Sep 2000 06:50:37 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: CGI.pm with explorer 5.0 (newbie question)
Message-Id: <slrn8s0u1r.4t8.tim@degree.ath.cx>
Robert Delisle <Groupesr@sympatico.ca> wrote:
> Someone can explain why a sript using CGI.pm (2.76) work fine wiith
> netscape 4.70 , explorer 4.0(windows 95) and DON't work with explorer
> 5.0 (windows 98).
No! Wait! I know this one! Ummm. Um. Hmm...
Simple answer:
mostly likely cuz MSIE5 ignores a few more standards. Adjust your
HTML.
Paranoid answer (but no less likely to be true):
M$ sees Perl, and therefore CGI.pm, as a threat to their monopoly.
And so ensues a deliberate attempt to misinterpret code output by
CGI.pm, thinking users will think it's a Perl/CGI.pm error and
begin using IIS/VBScript like all the good little robots.
It didn't work for Java cuz Sun Microsystems had money. But how
much money can an open-source programmer have, right?
--
-Tim Hammerquist <timmy@cpan.org>
Emacs is a nice OS - but it lacks a good text editor.
That's why I am using Vim.
-- Anonymous
------------------------------
Date: Thu, 14 Sep 2000 08:59:33 +0300
From: "Elisa Roselli" <e.roselli@volusoft.com>
Subject: Re: Character Class in Regex - Despecify What?
Message-Id: <8ppt8l$art$1@wanadoo.fr>
Sean McAfee wrote:
>If you save this as, say, filter.pl, and run it as
>
>perl filter.pl LYSANDER inputfile
>
>...it should print out all of Lysander's lines from the file.
> $/ = "";
Shouldn't it be $/ = "\n\n"; ?
Thanks, I'll play around with your suggestions if I get time off my regular
work today. What I'm actually trying to recover is not just a character's
lines, but also his leading cue. My logic is that I might be an actress
wanting an abbreviated file to study her lines in context for purposes of
quick memorisation.
So far, this is what I have been doing with the code, but I keep getting a
syntax error that I cannot locate:
#!/usr/bin/perl -w
#LineLearner.pl
# use strict;
while (<>) {
if (
m =~ /(^[A-Z]+) # All caps name of the
cueing character, $1
\t # The tab marks start of cue
([A-Za-z \n.,;:!?'()-]+\n\n) # The cue speech, $2
([A-Z]+) # All caps name of my
character, $3
\t # Tab marks start of my
speech
([A-Za-z \n.,;:!?'()-]+) # My speech
\n\n/xs # The two newlines mark end
of section
)
{
$cueChar = defined $1 ? $1 : "";
$cue = defined $2 ? $2 : "";
$myChar = defined $3 ? $3 : "";
$mySpeech = defined $4 ? $4 : "";
}
if ($myChar eq "LYSANDER") {print $_}
}
My logic in not setting the double newline as the block delimiter is to
force the regular expression to match over the whole unit from which I wish
to recover data, "giving back" the double newline to mark the end. This is
probably flawed, but I was afraid that I would be unable to capture the
variables $cueChar and $cue if they were not in the same block.
Thanks for your suggestions, and I'll keep batting at this surreptitiously
as I can.
Elisa Francesca Roselli
------------------------------
Date: Thu, 14 Sep 2000 17:59:20 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: cross-platform archive mgt
Message-Id: <MPG.142b1441f00d7b209897ae@localhost>
David P. Schwartz <davids@wwwwdesertigloo.com> wrote ..
>While I generally share your annoyance.......
you were going to get a reply - but your email address is broken and
this is too far off topic to continue here .. oh well
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Thu, 14 Sep 2000 17:42:39 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: Finding maximum length
Message-Id: <MPG.142b1057dc0c1a169897ac@localhost>
Ren Maddox <ren.maddox@tivoli.com> wrote ..
>jason <elephant@squirrelgroup.com> writes:
>
>> Jeff Pinyan <jeffp@crusoe.net> wrote ..
>> >On Sep 13, jason said:
>> >
>> >>Jeff Pinyan <jeffp@crusoe.net> wrote ..
>> >>>[posted & mailed]
>> >>>
>> >>>On Sep 13, greg_sands@my-deja.com said:
>> >>>
>> >>>>I'm trying to find the maximum length of the elements of an array. Both
>> >>>>of the following work, but can anyone come up with a simpler or more
>> >>>>elegant solution?
>> >>>>
>> >>> $len < $_ and ($len = $_) for @array;
>> >>
>> >>I thought the originator was after the element with the longest length -
>> >>not the numerically largest element
>> >
>> > s'$_'length'g;
>>
>> now you're left with $len containing the longest length .. not the
>> element *with* the longest length
>
>And that is what the OP wanted, the longest length not the longest
>element.
ha ha .. they did too .. my apologies
I had somehow confused this thread with the one on "Silly grep tricks"
and I had it in my mind that the element was to be returned
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Thu, 14 Sep 2000 17:43:10 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: Finding maximum length
Message-Id: <MPG.142b107cf747da519897ad@localhost>
Jeff Pinyan <jeffp@crusoe.net> wrote ..
>On Sep 13, jason said:
>
>>Jeff Pinyan <jeffp@crusoe.net> wrote ..
>>>>> $len < $_ and ($len = $_) for @array;
>>> s'$_'length'g;
>>
>>now you're left with $len containing the longest length .. not the
>>element *with* the longest length
>
>The one I had in my brain worked. Pshaw. The correct algorithm was the
>one the OP presented.
>
>And I was silly.
actually your (adjusted) answer met the specs .. 'twas I that was
confused
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 14 Sep 2000 04:17:27 GMT
From: haazi2@aol.com (Haazi2)
Subject: Getting File stats on a remote file
Message-Id: <20000914001727.29031.00002604@ng-cg1.aol.com>
I'm accessing audio files on a remote server and I need to retrieve the last
modified time of these files. How can I do this in Perl. Can I use File::stat
on files located on a remote server? Thanks for any help in advance. Please
respond to my email address below and post to the news group. Unfortunately I
can't access newsgroups from my office.
email: hali@lind-waldock.com
------------------------------
Date: 14 Sep 2000 05:32:34 GMT
From: abigail@foad.org (Abigail)
Subject: Re: golf (Was Re: transliterating file names in a dir)
Message-Id: <slrn8s0oli.ku0.abigail@alexandra.foad.org>
Stephen Kloder (stephenk@cc.gatech.edu) wrote on MMDLXXI September
MCMXCIII in <URL:news:39C04B8C.48B38120@cc.gatech.edu>:
-- Uri Guttman wrote:
--
-- >
-- > this is more what the OP wanted:
-- >
-- > $file =~ tr/A-Z /a-z-/ ;
-- >
-- > and in a loop it would be:
-- >
-- > tr/A-Z /a-z-/ for @files ;
-- >
--
-- This is starting to look like a golf problem: Rename all filenames in the
-- current directory so that all letters are lowercase, and all spaces are
-- replaced with dashes.
-- My submission:
-- perl -e 'rename"$_",(tr/A-Z /a-z-/+1&&$_)for(<*>)'
Saving 12 strokes:
perl -e'rename"$_",y/ /-/x0|lc,for<*>'
Abigail
--
map{${+chr}=chr}map{$_=>$_^ord$"}$=+$]..3*$=/2;
print "$J$u$s$t $a$n$o$t$h$e$r $P$e$r$l $H$a$c$k$e$r\n";
------------------------------
Date: 14 Sep 2000 06:11:45 GMT
From: abigail@foad.org (Abigail)
Subject: Re: golf (Was Re: transliterating file names in a dir)
Message-Id: <slrn8s0qv0.ku0.abigail@alexandra.foad.org>
Abigail (abigail@foad.org) wrote on MMDLXXI September MCMXCIII in
<URL:news:slrn8s0oli.ku0.abigail@alexandra.foad.org>:
:: Stephen Kloder (stephenk@cc.gatech.edu) wrote on MMDLXXI September
:: MCMXCIII in <URL:news:39C04B8C.48B38120@cc.gatech.edu>:
:: --
:: -- This is starting to look like a golf problem: Rename all filenames in the
:: -- current directory so that all letters are lowercase, and all spaces are
:: -- replaced with dashes.
:: -- My submission:
:: -- perl -e 'rename"$_",(tr/A-Z /a-z-/+1&&$_)for(<*>)'
::
:: Saving 12 strokes:
::
:: perl -e'rename"$_",y/ /-/x0|lc,for<*>'
I missed the obvious obfuscation touch:
perl -e'rename"$_",y, ,-,x0|lc,for<*>'
Also, if you can use external programs, you can save 2 strokes:
ls|perl -nle'rename"$_",y, ,-,x0|lc'
Abigail
--
:$:=~s:$":Just$&another$&:;$:=~s:
:Perl$"Hacker$&:;chop$:;print$:#:
------------------------------
Date: Thu, 14 Sep 2000 17:37:31 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: how to remove unprintable chars with Perl script
Message-Id: <MPG.142b0f27357e5a679897aa@localhost>
Rodney Engdahl <red_orc@my-deja.com> wrote ..
>In article <MPG.14296035653f238a989798@localhost>,
> jason <elephant@squirrelgroup.com> wrote:
>> Rodney Engdahl <red_orc@my-deja.com> wrote ..
>> >In article <8pm5ii$6k0$1@news.IAEhv.nl>,
>> > "Durk Gardenier" <d.gardenier@iae.nl> wrote:
>> >> This initially seemed easy , but it has taken
>> >> me quite some time and I still have not found
>> >> an answer.
>> >>
>> >> If a file contains unprintable characters, how can I
>> >> remove them with a perl script?
>> >>
>> >
>> >you could try a regular expression and specify the characters you
>want
>> >to remove:
>> >
>> >$var = "a bunch of characters, and considering the 'c' and 'e' to be
>> >unprintable for example.";
>> >
>> >$var =~ s/(?:c|e)//g;
>>
>> I think you might have missed the point Rodney .. 'unprintable
>> characters' usually refer to control characters like "\b" and "\a" ..
>> see the documentation pointers I mentioned elsewhere in this thread if
>> you're interested
>>
>
>no, i did not miss the point. unprintable characters in the sample
>would not have shown up in this post, so I used printable characters to
>_illustrate_ the point.
yeah but .. you also can't put unprintable characters into a regex in
Perl .. hence the Perl metacharacters that I've shown above - which is
what you would need to put in the regex (or in tr///d)
I think it just boils down to what the originator was really having
trouble with .. whether it was a substitution ? .. or whether it was the
fact that what they were trying to remove were unprintable
if it was the latter (as I assumed) then your example sheds little light
on how to deal with those specific beasties
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Thu, 14 Sep 2000 12:05:25 +0800
From: Carfield Yim <c8133594@comp.polyu.edu.hk>
Subject: How to use regular expression with GB code in Perl?
Message-Id: <Pine.GSO.4.21.0009141204450.11600-100000@cs-cs01>
How to use regular expression with GB code in Perl? After I wrote my
application, I find that the program always show:
Malformed UTF-8 character at count_freq.pl line 32, <DATA_FILE> line 5.
How can I solve??
I think that the problem is GB code is 16 bit but not 8 bit. However, how
to use UTF 16 is perl??
------------------------------
Date: Thu, 14 Sep 2000 02:00:06 -0400
From: peter <peterp100@hotmail.com>
Subject: Re: I really need help !!!!
Message-Id: <b1q0ss0i5j793tt66bv6r31vsl4njlijtt@4ax.com>
Hey, thanks a lot, you really help me out!!!
I've just about got it to work (after a crash course in Apache).
Now the only thing that is stopping my cgi from working is the fact
that I can't run the geturl.cgi (perl script) from my /html dir
because of the PATH setup on my linux machine.
I've tried changing it with "PATH=/xxx" stuff, but it doesn;t work.
more help would be greatly appreciated...
Thanks,
Peter
> You should look for the solution to your
>problem not in the HTML or perl code, but rather in the configuration of
>you server. The first question you asked ([first, what is this...]) has
>an easy answer. That was the program that was a few pages back that
>contained the code that does the dirty work. Let me guess, you never read
>the other chapters, right? You just jumped into this chapter, started
>typing the programs in and expected them to work without doing any
>research even in the book you were reading?
>> I'm having a hell of a time trying to get my perl cgi scripts to work.
>>
>> I'm using Mandrake 7.1, and I'm working out of a book called: Perl,
>> CGI, and JavaScript, by Sybex.
>>
>> Right now I'm working in chapter 12: Creating Real-World HTML Forms
>> with Perl and CGI.
>>
>> I've got a few question about HTML and Perl code, what is happening
>> here is that a user will enter his data and then push the submit
>> button and then the data will be displayed in a new page.
>>
>> THIS IS THE PERL [file name: geturl.pl]:
>>
>> #!/usr/bin/perl
>>
>> require "/pub/scripts/perl-cgi/html.pl";
>> [first, what is this?, the book doesn't say, and no such file or dir
>> exists on my system]
>>
>> $Title = "Get Information From A URL";
>>
>> $QueryString = $ENV{ 'QUERY_STRINGS'} ;
>>
>> @NameValuePairs = split (/&/, $QueryString);
>>
>> &HTML_Header ($Title);
>> print "\n";
>> print "<H1>$Title</H1>\n";
>> print "<HR>\n";
>>
>> foreach $NameValue (@NameValuePairs)
>> {
>> ($Name, $Value) = split (/=/, $NameValue);
>> print "Name = $Name, value = $Value<BR>\n";
>> }
>>
>> $HTML_Ender;
>>
>> AND HERE IS THE HTML:
>>
>> <html>
>> <head>
>> <title>Visitor Information Form</title>
>> </head>
>> <body>
>> <h1 align="left">Visitor Information Form</h1>
>> <hr>
>> <form action="geturl.pl" METHOD="GET">
>>
>> [I'm not sure which dir the form action should point to, in my config
>> files, apache says: protected-cgi-bin/ /home/httpd/protected-cgi-bin/]
>>
>> <b>
>> Last name: <INPUT TYPE="text" NAME="LastName" SIZE=16>
>>
>> First name: <INPUT TYPE="text" NAME="FirstName" SIZE=16>
>> <br><br>
>>
>> Address: <INPUT TYPE="text" Name="Address" SIZE=32>
>>
>> City: <INPUT TYPE="text" NAME="City" SIZE=32>
>> <br><br>
>>
>> State: <INPUT TYPE="text" NAME="State" SIZE=2>
>> <br><br>
>> </b><center><b>
>> <INPUT TYPE="submit" VALUE="Send Information">
>> <INPUT TYPE="reset" VALUE="Clear Form Fields">
>> </b>
>>
>> </center></form>
>> </body>
>> </html>
>>
>> [Unfortunately this book does a poor job, I'll probably return it, can
>> anyone tell me a good book about cgi (perl-cgi) that's worth the paper
>> it's printed on ?]
------------------------------
Date: Thu, 14 Sep 2000 17:39:48 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: killfiles? scores? I wish I had these luxuries
Message-Id: <MPG.142b0fb3d1868d239897ab@localhost>
Colin Watson <cjw44@flatline.org.uk> wrote ..
>jason <elephant@squirrelgroup.com> wrote:
>>Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote ..
>>>Get thineself to www.mutt.org and sin no more :)
>>
>>read *before* you post oh-shocked-one .. Jeff is using pine as a *news*
>>reader
>
>There are NNTP patches for mutt. One of my friends uses mutt-nntp as a
>news reader (I still think she should just give in and use trn, but
>hey).
hear that Gwyn .. you're not a (and I just want you to know that this
word has been frollicking in my vocabulary all day) poopyhead afterall
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Thu, 14 Sep 2000 15:31:09 +1000
From: Dave O'Brien <david.obrien@ssmb.com.au>
Subject: print and CGI scripts
Message-Id: <39C0629D.10478C67@ssmb.com.au>
This seems like a simple proble, but I can't find any doco on it.
I am writing a CGI script that takes some user settings, and then then
processes, and creates some new files.
My problem is that all print commands are directed to the browser. using
CGI.pm, which uses the print "Content-type:text/html\n\n"; statement.
How do I revoke this?
I am creating the files with something like
open (HTML_FILE,$file_name);
open (NEW_SHTML_FILE,">$new_file");
while (<HTML_FILE>)
{
# do stuff
print NEW_SHTML_FILE $_;
}
close(NEW_SHTML_FILE);
close(HTML_FILE);
As you can see, very simple. All I want to do, is temporarily redirect
print statements back to the terminal, and not the browser.
I've looked in FAQs and the web, but not having any luck
thanks
Dave
------------------------------
Date: Wed, 13 Sep 2000 22:23:57 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: print and CGI scripts
Message-Id: <39C060ED.A892D249@stomp.stomp.tokyo>
Dave O'Brien wrote:
> My problem is that all print commands are directed to the browser. using
> CGI.pm, which uses the print "Content-type:text/html\n\n"; statement.
> How do I revoke this?
Have you considered this? If you are accessing your
script through a browser, output will be to your
browser. Should you access your script from a
command line prompt, output will be to your
command screen. Telnet access, your output
will be to your telnet terminal. Are you
expecting your output to go elsewhere?
If you want to see your output on your
terminal, whatever you mean by this,
access your script via your terminal.
Logical don't you think?
Have you given thought to
not using cgi.pm if it
is giving you fits?
Godzilla!
--
Dr. Kiralynne Schilitubi ¦ Cooling Fan Specialist
UofD: University of Duh! ¦ ENIAC Hard Wiring Pro
BumScrew, South of Egypt ¦ HTML Programming Class
------------------------------
Date: Thu, 14 Sep 2000 17:26:11 +1000
From: Dave O'Brien <david.obrien@ssmb.com.au>
Subject: Re: print and CGI scripts
Message-Id: <39C07D93.BF0F45BF@ssmb.com.au>
"Godzilla!" wrote:
>
> Dave O'Brien wrote:
>
> > My problem is that all print commands are directed to the browser. using
> > CGI.pm, which uses the print "Content-type:text/html\n\n"; statement.
> > How do I revoke this?
>
> Have you considered this? If you are accessing your
> script through a browser, output will be to your
> browser. Should you access your script from a
> command line prompt, output will be to your
> command screen. Telnet access, your output
> will be to your telnet terminal. Are you
> expecting your output to go elsewhere?
>
> If you want to see your output on your
> terminal, whatever you mean by this,
> access your script via your terminal.
>
> Logical don't you think?
>
> Have you given thought to
> not using cgi.pm if it
> is giving you fits?
>
> Godzilla!
> --
> Dr. Kiralynne Schilitubi ¦ Cooling Fan Specialist
> UofD: University of Duh! ¦ ENIAC Hard Wiring Pro
> BumScrew, South of Egypt ¦ HTML Programming Class
Logical, but you must have misunderstood. The script is a CGI script.
It won't be run at the terminal. What I'm trying to do, is prevent
print to file statements, printing to the browser. Otherwise every file
I generate, will print to the browser, which would be nasty if I were
processing a couple of hundred files.
It is not CGI.pm doing it. It is the standard print
"Content-type:text/html\n\n"; statement, to get into CGI "mode" so to
speak. I just happen to be using CGI.pm, but I would have the same
problems if I were using cgi-lib.pl or writing the http handlers myself.
thanks though
Dave
------------------------------
Date: Wed, 13 Sep 2000 23:53:33 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: print and CGI scripts
Message-Id: <39C075ED.8734386D@stomp.stomp.tokyo>
Dave O'Brien wrote:
> "Godzilla!" wrote:
> > Dave O'Brien wrote:
> The script is a CGI script.
> It won't be run at the terminal.
This is untrue. Your script will output to
a browser, to a command screen or a telnet
terminal. First case you, a browser, you
are hot for html. Last two cases, you
receive plain text prints.
A form action and similar won't work for
plaintext output, still gonna print
regardless, still gonna run, regardless.
Take out html content type, your script
is still going to print just as soon
as it hits "print" on a line.
*laughs*
How will you prevent a print, regardless
of type, html, plaintext or other, if
you include a print command in your
script? Well?
After reading over the rest of your
article, reading your self-contradictory
statements, changing parameters, your
argumentive nature, exceptional illogic,
believe you to be full of mule manure
and trolling.
Godzilla!
--
Dr. Kiralynne Schilitubi ¦ Cooling Fan Specialist
UofD: University of Duh! ¦ ENIAC Hard Wiring Pro
BumScrew, South of Egypt ¦ HTML Programming Class
------------------------------
Date: Thu, 14 Sep 2000 06:41:04 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: Req.: The perfect Perl Editor?
Message-Id: <slrn8s0tfu.4t8.tim@degree.ath.cx>
Andreas Leiberger <andreas@gispi-sport.de> wrote:
> Is there a software for creating perl scripts that includes an excellent
> help documentation. I'm a fan of the mark+F1 technique. I kind of miss that
> in Notepad. :-)
> Can you recommend any programm in this context.
Oblivious as to the "mark+F1" comment.
I miss a lot of things in Notepad.
Anyone can recommend an editor, and while I sort of understand your
logic in asking for a perl editor in a perl NG, it's really not an
issue. Despite the normally good taste most Perl fans have, some have
been known to use Emacs. *gasp!*
Because I like occasional vacations into a delusional world where my
opinion or preference means more than the next persons, I'll tell you
what I use in order of preference:
Unix/Linux:
vim ( http://www.vim.org )
nvi, vile, or vanilla vi
pico
emacs
On Win32:
Win32 port of vim ( http://www.vim.org )
UltraEdit-32 ( http://www.ultraedit.com ; ~US$30 )
Homesite 4.x ( http://www.allaire.com ; ~US$90 )
Notepad
Many people like to buy $200 to $500 editors from commercial software
companies. I'm not one of those people.
For a much more detailed (and aggressive) argument, I highly recommend
comp.editors newsgroup.
--
-Tim Hammerquist <timmy@cpan.org>
Be different: conform
-- fortune-mod version 9708
------------------------------
Date: Wed, 13 Sep 2000 23:50:55 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Returning values of unticked checkbox
Message-Id: <MPG.142a152350e4bf5998ad61@nntp.hpl.hp.com>
In article <psRv5.202$L46.240821@news.uswest.net>,
jerome@activeindexing.com says...
> Geoff Soper <g.soper@soundhouse.co.uk> elucidates:
> > If a single checkbox in an HTML form is unticked, is its parameter as
> > returned by CGI.pm undef or "" ?
>
> In either case, it will evaluate false in a boolean test.
>
> > <input type="checkbox" name="box" checked value="yes">
> >
> > This gives $form_data{"box"}[0] the value of "yes" when ticked but I want
> > $form_data{"box"}[0] to have the value of "no" when not ticked, how can I
>
> Test it for truth, and populate as needed.
>
> $form_data{"box"}[0] = ($form_data{"box"}[0]) ? $form_data{"box"}[0] : 'no';
Too many notes, Herr Mozart!
$form_data{box}[0] ||= 'no';
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 13 Sep 2000 23:42:39 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Silly grep tricks
Message-Id: <MPG.142a133ef297f9e98ad5f@nntp.hpl.hp.com>
In article <968895240.227134@elaine.furryape.com>,
gorilla@elaine.furryape.com says...
...
> print "",(grep { /e/ } @a)[0],"\n";
>
> Note, if you pass it to print, you'll have to force the parser to not
> interpt the parenthesis as a function, that's what the useless "" is for.
Instead of 'the useless ""' argument, a simple unary '+' is more
general, more obvious, trivially more efficient, and two strokes
shorter.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 13 Sep 2000 23:46:30 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: slick way to look at array?
Message-Id: <MPG.142a141c138d17b798ad60@nntp.hpl.hp.com>
In article <8ppbrh$ic$1@brokaw.wa.com>, lauren_smith13@hotmail.com
says...
>
> Damian Conway <damian@cs.monash.edu.au> wrote in message
> news:8pp9im$d6u$1@towncrier.cc.monash.edu.au...
> > Cynthia Rossbach <crossbach@atgi.net> writes:
...
> > >What is a slick way to do the following (one liner perferred):
> >
> > >$answer = Is ("tt Admin" or "Admin" or "tt Assign") in @groups ?
> >
> > use Quantum::Superpositions;
> > $answer = any("tt Admin", "Admin", "tt Assign") eq any(@groups);
>
> Wow! O(1)! You can't beat that!
But what is the multiplier?
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 14 Sep 2000 04:04:40 GMT
From: michaelgartlan@my-deja.com
Subject: SYSTEM calls within perl script
Message-Id: <8ppioc$g0d$1@nnrp1.deja.com>
HI ,
I am really stuck on this issue and I would
be very grateful for any help, ideas, suggestions
for solving my problem (hopefully a solution exists)
Makin a long story short....I have a perl script from
which I want to launch and execute another executable
(the executable is a verilog simulator)
Currently I am doing this using a system call i.e.
system($simulator_cmd) == 0 or die("simulation failed!\n");
The problem is that there is a need to be able to
interrupt the simulator in the middle of a simulation
using ctrl-C (and then enter debug commands at the
simulation prompt)
and unfortunately system (or bacticks) block
SIGINT (ctrl-c).
(therefore the simulator can not be interrupted which
means it is impossible to debug a simulation or even
to kill a simulation (press ctrl-c twice) )
I hope that this is a failing in my knowledge of
perl and not a failing in the language.
All help greatly appreciated,
cheers
Michael.
PS Some more background:
Note previously my 'master' script was written in bash
shell scripting language - there I was able to
launch the simulator, and at any time interrupt the
simulator using ctrl-c, I could then enter simulator
debug commands at the simulator prompt and when finished
debugging I could tell simulator to continue simulating
by giving the simulator run command - the simulator would
then continue to completion and the 'master' script
which launched the simulator would continue executing
- this is the same functionality which I need to
maintain when writing the 'master' script in perl
(If I use double ctrl-c while simulator is running then
simulator will exit)
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 14 Sep 2000 17:36:40 +1000
From: Dave O'Brien <david.obrien@ssmb.com.au>
Subject: Re: SYSTEM calls within perl script
Message-Id: <39C08008.FA080544@ssmb.com.au>
michaelgartlan@my-deja.com wrote:
>
> HI ,
>
> I am really stuck on this issue and I would
> be very grateful for any help, ideas, suggestions
> for solving my problem (hopefully a solution exists)
>
> Makin a long story short....I have a perl script from
> which I want to launch and execute another executable
> (the executable is a verilog simulator)
>
> Currently I am doing this using a system call i.e.
>
> system($simulator_cmd) == 0 or die("simulation failed!\n");
>
> The problem is that there is a need to be able to
> interrupt the simulator in the middle of a simulation
> using ctrl-C (and then enter debug commands at the
> simulation prompt)
> and unfortunately system (or bacticks) block
> SIGINT (ctrl-c).
>
> (therefore the simulator can not be interrupted which
> means it is impossible to debug a simulation or even
> to kill a simulation (press ctrl-c twice) )
>
> I hope that this is a failing in my knowledge of
> perl and not a failing in the language.
>
> All help greatly appreciated,
>
> cheers
>
> Michael.
>
> PS Some more background:
> Note previously my 'master' script was written in bash
> shell scripting language - there I was able to
> launch the simulator, and at any time interrupt the
> simulator using ctrl-c, I could then enter simulator
> debug commands at the simulator prompt and when finished
> debugging I could tell simulator to continue simulating
> by giving the simulator run command - the simulator would
> then continue to completion and the 'master' script
> which launched the simulator would continue executing
> - this is the same functionality which I need to
> maintain when writing the 'master' script in perl
> (If I use double ctrl-c while simulator is running then
> simulator will exit)
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Can you set the SIGINT values to be non-trapped? Something like
$SIG{'INT'} = 'sub_routine';
This should trap the SIGINT signal, and exe the routine (I think). We
used this for making a captive login menu, but I would think it could
work in reverse. good luck
Dave
------------------------------
Date: Thu, 14 Sep 2000 08:24:14 +0300
From: "Elisa Roselli" <e.roselli@volusoft.com>
Subject: Re: Teaching Perl
Message-Id: <8ppr6e$4rf$1@wanadoo.fr>
Randal L. Schwartz a écrit dans le message ...
>I have a huge admiration for anyone who makes it in the training biz
>without going totally nuts. Sometimes, I'm not so sure about
>myself. :)
Well, thanks for hanging in there, and for upholding the teacher's craft so
well. I got much out of the book you co-authored LEARNING PERL and was going
to suggest to Tim that he use it as a class textbook.
Elisa Francesca Roselli
(Ex-teacher of natural languages and would-be technical writer who regards
O'Reilly authors as stars of the firmament)
------------------------------
Date: Thu, 14 Sep 2000 05:01:45 GMT
From: the_crowbar@my-deja.com
Subject: Working with IP addresses
Message-Id: <8ppm3h$jig$1@nnrp1.deja.com>
Perl gurus:
I have a CGI script that accepts two IPs from fields in a form. The
octets of the IPs are stored in 8 variables. I am trying to do several
actions on each IP from the starting IP to the ending IP. The problem I
am having is when the IPs do not define a class C address or a CIDR
block.
Ex.
Starting IP: 10.1.1.1
Ending IP: 10.1.2.5
I want the script to act on 10.1.1.1-10.1.1.255 and 10.1.2.1-10.1.2.5. I
cannot figure out the logic the script needs to be able to count through
the IPs. Any ideas/pointers/code snipets etc is greatly appreciated.
Thanks,
James
crowbar@no.spam.remove.lucent.com
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 4320
**************************************