[12585] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6185 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 1 01:07:24 1999

Date: Wed, 30 Jun 99 22:00:17 -0700
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, 30 Jun 1999     Volume: 8 Number: 6185

Today's topics:
    Re: "push" 2 dim array (Ronald J Kimball)
    Re: $1 not defined after AND ? (Ronald J Kimball)
    Re: 2 simple (not to me tho) questions <uri@sysarch.com>
    Re: 2 simple (not to me tho) questions (Steve Lamb)
    Re: Apples and Oranges (Ronald J Kimball)
    Re: Can not write my file to the server (Filip M. Gieszczykiewicz)
        Copying Lines to File rt_daemon@my-deja.com
        differentiate btw big-endian machine and small-endian m bennycc@pacific.net.sg
    Re: Foreach on hash gives undefined value (Ronald J Kimball)
        How do I join CGI stuff to existing web pages? (simple) <gjohn@crossland.com.au>
    Re: inplace edit (Ronald J Kimball)
        Making things go "BEEP!" alex@inova.com.br
        NEWBIE CODES AGAIN!! BETTER THIS TIME <cameron_graham@clear.net.nz>
        Newbie is back!! This time knows his stuff (he thinks) <cameron_graham@clear.net.nz>
    Re: Picture doesn't appear (Ronald J Kimball)
    Re: POP3 and FTP by email in Perl <splattael@gmx.net>
    Re: q qq or qw (Martien Verbruggen)
        regex to match RCS string <Tim.Potter@anu.edu.au>
    Re: returning a hash from a function ()
        sorting info from Hashes (Michboy832)
        Using sockets <streaking_pyro@my-deja.com>
    Re: What is rally_results()??? ()
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Wed, 30 Jun 1999 23:08:02 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: "push" 2 dim array
Message-Id: <1du8fi4.1wr2imu1kzinuwN@p0.tc8.metro.ma.tiac.com>

<kgentes@gentek.net> wrote:

> # push @{$TelProbRec{ProbeMicro}}, [@fields [2..4]];

> [...]

> My question, though, is why does the first one not
> work- or more correctly- what stupid mistake did
> I make in massaging the syntactical form of the
> push'es first parameter that was incorrect?

That syntax is correct, and it should work just fine.  What led you to
believe otherwise?

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Wed, 30 Jun 1999 23:08:04 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: $1 not defined after AND ?
Message-Id: <1du8fmy.1ek3cc6cg9nr4N@p0.tc8.metro.ma.tiac.com>

David Pautler <pautler@hawaii.edu> wrote:

> while( ($page =~ s| "(http [^"]*? isbn \s* ~ \s* (\d+ X?) [^"]*? )" .*?
> >(.*?)< ||six ) #){
>        and ($3 =~ m|$requested_title|six) ) {
                    ^^^^^^^^^^^^^^^^^^^^^^^

You just clobbered the special variables from the first match.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
perl -e '$_="\012534`!./4(%2`\cp%2,`(!#+%2j";s/./"\"\\c$&\""/gees;print'


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

Date: 30 Jun 1999 23:24:32 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <x7so793vdb.fsf@home.sysarch.com>

>>>>> "SL" == Steve Lamb <morpheus@despair.rpglink.com> writes:

  SL> print($foo);

passing a var to print

  SL> print("$bar\n");

passing an double quoted string with interpolated var to print

  SL> print("$foo");

passing a useless double quoted var to print

  SL> print("$bar\n");

passing an double quoted string with interpolated var to print

  SL>     Wow, george, it is consistancy!  God, that is *SO* misleading.
  SL> Wow, I never saw that before.  Geez, I mean, wow!  Thank you *SO*
  SL> much for pointing that out to me.

but that may only be ok for print (if at all). so what do you do with
other functions or subs? quoting a single variable is always
misleading. using a variable in a quoted string with a newline is not
the same however much it may look like it to you. one is concatenating
stuff, the other is just stringifying it.

  SL>     Let me be blunt about this, not that you ever read anything
  SL> anyone else actually writes, only what you think they write.

in your case what you write had no content so he had to do the thinking
for both of you.

  SL>     IT IS MY CODE, THAT IS WHAT *I* DO AND IN THAT INSTANCE IT
  SL> PROVIDED NO HARM.  WHEN YOU CHALLENGED IT I POINTED OUT THE
  SL> SPECIFIC CASES THAT I USED IT UNDER.  YOU, HOWEVER, DECIDED TO BE
  SL> A PRICK ABOUT IT ("Look Maude, I have a live one here!"), FAILED
  SL> TO QUOTE THE RELEVENT PARTS OF MY POST AND THEN WENT ON A
  SL> COMPLETELY DIFFERENT TANGENT.

if it is your code, then why post it in public? better to keep you mouth
shut and your code to yourself. and shouting and repeating your
infantile responses about one point in a book is not going to win you
any points here. but i don't think that is your goal. you want to show
how brave you are to stand up to tom. bravo, little man! you sure showed
him. now i bet no one will ever again read tom's posts and yours
will rise to the top of the score files.

as for your vaunted page 10 of the camel, it talks about TIMTOWTDI,
which is fine. i am teaching a perl class to 10 newbies (bright ones,
unlike you) and i show multiple legal ways to do things. but i emphasize
WHY each can be selected if desired and which is the better way based on
multiple criteria. clearness of intent is a major criterion and quoting
a single vars is not clear. period. you lose. you have to get out of the
pool now.

  >> *PLONK* for undue acrimony and amaritude.

  SL>     Good, at least I won't have to put up with your snobbery and
  SL> utter lack of respect for anyone else.

well, if i used kill files i would plonk you too. instead i may peruse
some of your dribble and chortle at how stupid you are. oh, well. i have
to get my jollies somehow.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 1 Jul 1999 04:40:04 GMT
From: morpheus@despair.rpglink.com (Steve Lamb)
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <slrn7nls93.kj3.morpheus@rpglink.com>

On 30 Jun 1999 23:24:32 -0400, Uri Guttman <uri@sysarch.com> wrote:
>but that may only be ok for print (if at all). so what do you do with
>other functions or subs? 

    I don't quote, which is what I pointed out to Tom after his first reply.
After that he decided not to quote that one important part and got all
snobbish about it.

>if it is your code, then why post it in public? 

    Because I was being polite and offering a solition to someone's problem.

>better to keep you mouth shut and your code to yourself. and shouting and
>repeating your infantile responses about one point in a book is not going to
>win you any points here. but i don't think that is your goal. you want to
>show how brave you are to stand up to tom. bravo, little man! you sure showed
>him. now i bet no one will ever again read tom's posts and yours will rise to
>the top of the score files.

    Actually, no.  I don't give a shit who it was.  He came off like a snob,
blantently ignored what I said and then went on his own little personal
crusade.  It could have been Tom or Billy-Bo-Bob from Beumont.

>clearness of intent is a major criterion and quoting a single vars is not
>clear. 

    In your opinion.  

>period. you lose. you have to get out of the pool now.

    Sorry, I don't get out for other people's opinions, esp. when they don't
read the entire thread and would know the answers to half the questions posed
if they did.

>well, if i used kill files i would plonk you too. instead i may peruse
>some of your dribble and chortle at how stupid you are. oh, well. i have
>to get my jollies somehow.

    Feel free, makes me all warm in fuzzy inside knowing there are
self-ritious pricks like you in the world that hate me.  Ooooo, scared me, you
did.  

    Making readable code, legable code, is also a major criterion.  The
examples I posted above, that you snipped, were simplified but showed exactly
why I double quote on a print unless there is a good reason not to.  It makes
it consistent with the rest of my prints.  To me, that *IS* "clearness of
intent."  

    So, go back to writing your obviously illegible code as is your wont and
I'll continue writing code that I find quite legible as do all of my
coworkers.

-- 
         Steve C. Lamb         | I'm your priest, I'm your shrink, I'm your
         ICQ: 5107343          | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------



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

Date: Wed, 30 Jun 1999 23:08:08 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Apples and Oranges
Message-Id: <1du8g03.bkclp52zziv7N@p0.tc8.metro.ma.tiac.com>

Tad McClellan <tadmc@metronet.com> wrote:

> William Herrera (posting.account@lynxview.com) wrote:
> : Worse than that, it thinks it IS the $n variable It only looks at the
> : leading number! 
> 
> 
>    That's what perldata.pod says about variable names that start
>    with a digit:
> 
>       "Strings that match parenthesized parts of a
>        regular expression are saved under names containing 
>        only digits after the $"
>        ^^^^^^^^^^^

I'm at a loss to understand how "starts with a digit" means the same
thing as "contains only digits".

/^\d/
/^\d+(?!\n)$/

This may be the only case where you cannot specify an arbitrary variable
name as a symbolic reference.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 1 Jul 1999 03:10:52 GMT
From: fmgst+@pitt.edu (Filip M. Gieszczykiewicz)
Subject: Re: Can not write my file to the server
Message-Id: <7lem7s$e0e$1@usenet01.srv.cis.pitt.edu>

In Article <x3yzp1ibvc9.fsf@tigre.matrox.com>, through puissant locution, Ala Qumsieh <aqumsieh@matrox.com> soliloquized:
>"Jim Ray" <jim.ray@west.boeing.com> writes:
>> I am converting my UNIX perl scripts over to NT and I am having some
>> problems.
>> Right now the following code will create a file on the server.  Under UNIX,
>> no problem, under NT big problem.
>> Here's the code...
>>    open(DATA, ">>$dataname");
>
>I am surprised no one has told you to check the value of your
>open(). So I'll do it. Check the value of your open().
>    open(DATA, ">>$dataname") || die "Can't append to $dataname: $!\n";
>This might or might not solve your problem, but it's a Good Thing (tm)
>to do .. always.

Speaking of robots to monitor this group - whenever anyone suggests
"die" in a cgi-bin environment... NEVER just "die()" in a cgi-bin
script - ANY output to STDOUT without the proper preamble will yield
a Server Error 500 - which is incredibly uninformative. 

Personally, I write errors to a log file in /tmp but for REALLY short
scripts, I call "&Die()" which checks for a global variable that gets
set by "&OutputHeader()" - if 1 then just print error, ! output a header
THEN the error. Saves SOOOOOOooooOOOO much hassle.
-- 
Filip "I'll buy a vowel" Gieszczykiewicz  |  http://www.repairfaq.org/

                   Always and everything for the better!
 Now exploring whatever, life, and the meaning of it all... and 'not' :-)


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

Date: Thu, 01 Jul 1999 04:23:02 GMT
From: rt_daemon@my-deja.com
Subject: Copying Lines to File
Message-Id: <7leqet$34a$1@nnrp1.deja.com>

Greetings,

I am a novice.
I would like to know how could I possibly read a file and start copying
lines to another file until a certain line. Here's an example.

Text, Text
<!--Start-->
 ....................
 ....................
 ....................
 ....................
<!--End-->
More Text

Copy everything between Start and End to another file.


Thanks,

Daemon
Webmaster

rt_daemon@yahoo.com
http://rt-daemon.virtualave.net/


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 01 Jul 1999 11:44:10 +0800
From: bennycc@pacific.net.sg
Subject: differentiate btw big-endian machine and small-endian machine
Message-Id: <377AE40A.95B5666E@pacific.net.sg>

Hi,

    How can i differentiate  btw big and small endian machine in my
codes?

Benny
bennycc@pacific.net.sg



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

Date: Wed, 30 Jun 1999 23:08:10 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Foreach on hash gives undefined value
Message-Id: <1du8gda.1fhetsvygt5csN@p0.tc8.metro.ma.tiac.com>

Thomas Weholt <thomas@bibsyst.no> wrote:

> >
> > Nobody knows because you didn't post the actual code you're using.
> 
> I used the code I the posting. You did see the perl-like text there didn`t
> you?

That was not your actual code; it did not compile, as Tom Phoenix
clearly explained in his post (you snipped that part in your reply).

I also tried running your code, noticed that it did not compile, and
moved on to the next post.

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Thu, 01 Jul 1999 04:33:18 GMT
From: GJohn <gjohn@crossland.com.au>
Subject: How do I join CGI stuff to existing web pages? (simple)
Message-Id: <7ler2e$3a7$1@nnrp1.deja.com>

We want to do our first web site which interacts with a db. I have been
learning Perl & DBD:DBI on the weekends, so I can write CGI scripts
which accept data from user & display info from the database along with
a few HTML tags to display headers etc. But it doesn't look pretty.
Others in our company have skills in Dreamweaver to create pretty web
sites, but without the db interaction. The boss says these designers
should learn PHP3, but I want to be part of the new project & therefore
I am pushing to use my existing Perl skills (I don't know PHP3). What I
need to do is get the pretty pages output from Dreamweaver & then add
my CGI stuff.

For example, the designers want to create the page with frames,
images,& form in Dreamweaver. Once the form is submitted, the data is
either added to db or used to query db. Some rows are returned &
displayed in a table on a web page.

I assume that the HTML page should call my script which interacts with
db. I'm not sure about how this is done, or how I should return data to
the HTML page for display.

Sorry if this question is too basic. Up to this point I have only had
experience in writing CGI scripts which include the HTML tags for the
form and the HTML tags for the table as part of a single .cgi file.
Perhaps a couple of Web sites have all the info I need to fill in the
gaps in my knowledge?

Thanks

Gary Robertson


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 30 Jun 1999 23:08:10 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: inplace edit
Message-Id: <1du8gyl.1wi9pkd19t2up3N@p0.tc8.metro.ma.tiac.com>

Kenneth Massey <kpmasse@cs.sandia.gov> wrote:

> Here is the sum content of those 2 files on that subject:
> 
> $INPLACE_EDIT
> $^I
> 
>      The current value of the inplace-edit extension. Use undef to
> disable inplace editing. (Mnemonic: value of -i switch.) 

No, that's only the content from the first of these two files:

> > perldoc perlvar
> > perldoc perlrun

Now check the other one.  Keep in mind the reference to the -i switch.

-- 
#!/usr/bin/sh -- chipmunk (aka Ronald J Kimball)
      perl -s -e'print sort grep { /\s/ } keys %main::
            ' -- -is -' Just' -' another ' -'Perl ' -'hacker 
' http://www.tiac.net/users/chipmunk/ [rjk@linguist.dartmouth.edu]


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

Date: 30 Jun 1999 20:59:22 -0700
From: alex@inova.com.br
Subject: Making things go "BEEP!"
Message-Id: <7lep2q$20o7@drn.newsguy.com>

Hello,

How would one go about making a script produce an audible signal like the bell
of a PC speaker. I have several needs for this. My most urgent is a small
network monitoring script that I would like to put in CRON and when port X is
not responding my server will produce an audible alert. (note, it would have to
be the PC speaker, there is no sound card on the machine)

Any ideas would be greatly appreciated!

Many thanks,
Alex Panagides
Ceara, Brazil

PS. Platform Linux 2.0.36 / i386 / Debian 2.01



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

Date: Thu, 1 Jul 1999 15:32:31 +1200
From: "Cameron Graham" <cameron_graham@clear.net.nz>
Subject: NEWBIE CODES AGAIN!! BETTER THIS TIME
Message-Id: <hhBe3.1435$Dl.44446@news.clear.net.nz>

i hope i didnt offend anyone (not pointing fingers) last time with my
oh-so-terrible code....

to those that did reply (positivly), thanx.

heres the new code, disect it, tell me whats wrong, tell me ways of
improving PLEASE! =) thanx...

#!perl -w

#use strict;

# PAGE DATA IS RECIEVED HERE

@input=("name","qname","age","pclans","whyjoin","whyletu","icqpros","icqnet"
,"longon");

# INPUTS FROM THE PAGE ARE
# TAKEN FROM HERE ON AND
# ASSIGNED VARIABLES.

main: {
    if ( $input[0] eq '' )
           { $error="Please give me your real name"; }
               { &oppshtml }

    if ( $input[1] eq '' )
           { $error="Please give me your Quake name"; }
               { &oppshtml }

    if ( $input[2] eq '' )
           { $error="Please give me your age"; }
               { &oppshtml }

    if ( $input[4] eq '' )
           { $error="Why do you wanna join NovA?"; }
               { &oppshtml }

    if ( $input[5] eq '' )
           { $error="Why should we let you in NovA?"; }
               { &oppshtml }

    if ( $input[8] eq '' )
           { $error="How long have you been on Prosper?"; }
               { &oppshtml }
}

&savefile;
&thanxhtml

### SUBROUTINES ###

# SAVES EVERYTHING TO A FILE
sub savefile {

    $filename="apps/apps.txt";

    open(FILE, ">>$filename") || die;
    print FILE "********************************\n";
    print FILE "NAME: $input[0]\n"; #60
    print FILE "QUAKE NAME: $input[1]\n";
    print FILE "AGE: $input[2]\n";
    print FILE "PREVIOUS CLANS: $input[3]\n";
    print FILE "JOINING COS: $input[4]\n";
    print FILE "WE SHOULD LET COS: $input[5]\n";
    print FILE "ICQ-PROSPER: $input[6]\n";
    print FILE "ICQ-NET: $input[7]\n";
    print FILE "BEEN ON PROSPER FOR: $input[8]\n";
    print FILE "********************************\n";
    print FILE "\n";
    close(FILE);
}

# THE ERROR MESSAGE (IF APPLICABLE)
# IS GENERATED INTO A WEB PAGE HERE
sub oopshtml {

    print "Content-type: text/html\n\n";
    print <<HTML;
<HTML>
<HEAD>
<TITLE>WHOOPS! - SOMETHING WENT WRONG!<TITLE>
</HEAD>
<BODY>
<CENTER>
<h1>HAY!! $error</h1>
</CENTER>
</BODY>
</HTML>
HTML
    exit;
}

# THE THANK YOU HTML MESSAGE IS GENERATED HERE
sub thanxhtml {}
(yet to do this little bitty)

cheers again ppl!




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

Date: Thu, 1 Jul 1999 16:19:16 +1200
From: "Cameron Graham" <cameron_graham@clear.net.nz>
Subject: Newbie is back!! This time knows his stuff (he thinks)
Message-Id: <6ZBe3.1442$Dl.44403@news.clear.net.nz>

i hope i didnt offend anyone (not pointing fingers) last time with my
oh-so-terrible code....

to those that did reply (positivly), thanx.

heres the new code, disect it, tell me whats wrong, tell me ways of
improving PLEASE! =) thanx...

#!perl -w

#use strict;

# PAGE DATA IS RECIEVED HERE

@input=("name","qname","age","pclans","whyjoin","whyletu","icqpros","icqnet"
,"longon");

# INPUTS FROM THE PAGE ARE
# TAKEN FROM HERE ON AND
# ASSIGNED VARIABLES.

main: {
    if ( $input[0] eq '' )
           { $error="Please give me your real name"; }
               { &oppshtml }

    if ( $input[1] eq '' )
           { $error="Please give me your Quake name"; }
               { &oppshtml }

    if ( $input[2] eq '' )
           { $error="Please give me your age"; }
               { &oppshtml }

    if ( $input[4] eq '' )
           { $error="Why do you wanna join NovA?"; }
               { &oppshtml }

    if ( $input[5] eq '' )
           { $error="Why should we let you in NovA?"; }
               { &oppshtml }

    if ( $input[8] eq '' )
           { $error="How long have you been on Prosper?"; }
               { &oppshtml }
}

&savefile;
&thanxhtml

### SUBROUTINES ###

# SAVES EVERYTHING TO A FILE
sub savefile {

    $filename="apps/apps.txt";

    open(FILE, ">>$filename") || die;
    print FILE "********************************\n";
    print FILE "NAME: $input[0]\n"; #60
    print FILE "QUAKE NAME: $input[1]\n";
    print FILE "AGE: $input[2]\n";
    print FILE "PREVIOUS CLANS: $input[3]\n";
    print FILE "JOINING COS: $input[4]\n";
    print FILE "WE SHOULD LET COS: $input[5]\n";
    print FILE "ICQ-PROSPER: $input[6]\n";
    print FILE "ICQ-NET: $input[7]\n";
    print FILE "BEEN ON PROSPER FOR: $input[8]\n";
    print FILE "********************************\n";
    print FILE "\n";
    close(FILE);
}

# THE ERROR MESSAGE (IF APPLICABLE)
# IS GENERATED INTO A WEB PAGE HERE
sub oopshtml {

    print "Content-type: text/html\n\n";
    print <<HTML;
<HTML>
<HEAD>
<TITLE>WHOOPS! - SOMETHING WENT WRONG!<TITLE>
</HEAD>
<BODY>
<CENTER>
<h1>HAY!! $error</h1>
</CENTER>
</BODY>
</HTML>
HTML
    exit;
}

# THE THANK YOU HTML MESSAGE IS GENERATED HERE
sub thanxhtml {}
(yet to do this little bitty)

cheers again ppl!





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

Date: Wed, 30 Jun 1999 23:08:11 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Picture doesn't appear
Message-Id: <1du8ha4.bqpyae1u629drN@p0.tc8.metro.ma.tiac.com>

<j_a_p@my-deja.com> wrote:

> I am trying to show a picture from one of my perl scripts.
> 
> #!/usr/local/bin/perl
> 
> print "Content-type: text/html\n\n";
> 
> print "<IMG SRC=\"picture.gif\">";
> 
> however the picture doesn't show up.  Is there something special that
> needs to be done in order to display a picture.

That's not valid HTML.  You're missing <HTML>, <HEAD>, and <BODY>.


Perhaps you meant something like the following:

#!/usr/local/bin/perl

print "Content-type: image/gif\n\n";

open(GIF, 'picture.gif') or die "Unable to open picture.gif: $!\n";
                            # (error will show up in the server's log)

binmode(GIF); # in case you're on a Win32 server

undef $/;     # read all in one go

print <GIF>;  # print the gif data

-- 
 _ / '  _      /       - aka -
( /)//)//)(//)/(   Ronald J Kimball      rjk@linguist.dartmouth.edu
    /                                http://www.tiac.net/users/chipmunk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Wed, 30 Jun 1999 22:55:00 +0200
From: Peter Suschlik <splattael@gmx.net>
Subject: Re: POP3 and FTP by email in Perl
Message-Id: <377A8424.8EDF1A9B@gmx.net>

Jordan Hiller wrote:
 
> I am writing a "Web by email" program in Perl. I was wondering if there is a
> FTP-by-email program written in Perl for me to take a look at.

try:
perldoc Net::FTP

> Also, I'm not sure how to read email from a POP3 server in perl. Any pointers or
> sample code?

perldoc Net::POP3

Peter Suschlik

-- 
Learning German (lesson #432):
diese Eigennamen, dieser Arbeitskredit, loechern, das Arbeiterfront,
diese Parteifreien, auftreten, diese Parkanlagen, dieser Erbsuende.


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

Date: Thu, 01 Jul 1999 03:25:42 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: q qq or qw
Message-Id: <WcBe3.93$gB2.8727@nsw.nnrp.telstra.net>

In article <377AD62C.24BBEA9C@sprintmail.com>,
	Jeff Thies <cyberjeff@sprintmail.com> writes:
> What is the difference between using:
> 
> q{}
> qq{}
> qw{} ???

# perldoc perlop

q/STRING/ - single quoted string
qq/STRING/ - double quoted string
qw/STRING/ - returns list of 'words' extracted from string

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | This matter is best disposed of from a
Commercial Dynamics Pty. Ltd.       | great height, over water.
NSW, Australia                      | 


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

Date: 01 Jul 1999 14:22:18 +1000
From: Tim Potter <Tim.Potter@anu.edu.au>
Subject: regex to match RCS string
Message-Id: <6yoghx6ltx.fsf@acronym.anu.edu.au>

I'm trying to write a regex to match what rcsfile(5) defines as a
string.  From the manual page, a string is defined as

       string    ::=  @{any character, with @ doubled}*@

so I came up with the following regex

/^(@((@@)|([^@]))*@)$/

This regex works fine for small strings but for large strings (900
lines at ~40KB) perl crashes with a segmentation fault.  Does anyone
have any hints for rewriting this so it actually works?  )-:

Grab any large piece of text out of an RCS file and run it through the
following program to test.


Tim.

#!/usr/bin/perl -w

use strict;

undef $/;
my $text = <STDIN>;

print("match\n"), if ($text =~ /^(@((@@)|([^@]))*@)$/);

-- 
Tim Potter, System Admin/Programmer              "Disco Stu doesn't advertise"
Advanced Computational Systems CRC, RSISE Bldg Australian National University,
Canberra 0200, AUSTRALIA Ph: +61 2 62798813 Fax: +61 2 62798602


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

Date: 1 Jul 1999 03:25:14 GMT
From: redmondm@yahoo.com ()
Subject: Re: returning a hash from a function
Message-Id: <slrn7nlnsu.cg9.redmondm@kells.kells>

In article <377ABD42.73F0F614@realware.com.au>, Derek Lavine wrote:
>I have a problem with returning a hash from a function of an object.
>
>I want to say something like
>
>use strict;
>...
>
>my %hash = $obj->get_hash_func;
>
>foreach $key (keys %hash ) {
> print "$key => %hash->{$key} \n";
>}
>
%hash is a hash, not as reference to one, so the %hash->{$key} above is
incorrect.  Also, the hash value is a scalar. It should be:
   print "$key => $hash{$key}\n";

Martin


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

Date: 01 Jul 1999 04:44:35 GMT
From: michboy832@aol.com (Michboy832)
Subject: sorting info from Hashes
Message-Id: <19990701004435.15727.00008558@ng-fp1.aol.com>

Ok, I want to print data from a hash into an email, but when I do this, the
info comes up randomly on the email.  How would I manipulate this into the
order I want?

Steve Peters


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

Date: Thu, 01 Jul 1999 04:20:36 GMT
From: R.Joseph <streaking_pyro@my-deja.com>
Subject: Using sockets
Message-Id: <7leqad$33b$1@nnrp1.deja.com>

I am using sockets for a server in Active Perl (under Win95).   The
only way I know how to handle mulitple connections to the server is by
using fork(), which can't be used in Win32.  Is there any other way to
do this??  Thanks in advance.

--
R.Joseph
http://www.24-7design.com
http://bowdown.to


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 1 Jul 1999 03:35:00 GMT
From: redmondm@yahoo.com ()
Subject: Re: What is rally_results()???
Message-Id: <slrn7nlof7.cg9.redmondm@kells.kells>

In article <7led95$19tu$1@earth.superlink.net>, Alex Peng wrote:
>Hi,
>
>I have read an example how to test web performance in Web Techniques.
>I am so interested this sample and I try to duplicate it.
>
>However, I can't pass tow thing in my Linux.
>
>1, How to install Time::HiRes?
>Since there is no installation instruction.
>I try perl Makefile.PL
>then, make but fail.
>

What's the error?

>2, What is rally_results?
>You can find the sample at
>http://www.webtechniques.com/cgi-bin/sourcecode/1999/07/webm/2.lst
>

tr/r/t/ =~ "rally";

>Thanks,
>
>Alex
>


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 6185
**************************************

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