[18397] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 565 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Mar 25 21:05:50 2001

Date: Sun, 25 Mar 2001 18:05:11 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <985572311-v10-i565@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 25 Mar 2001     Volume: 10 Number: 565

Today's topics:
    Re: Basic socket logic (server) discussion... <uri@sysarch.com>
    Re: Basic socket logic (server) discussion... <thomastk@prodigy.net>
    Re: Can Someone Explain This, Please? <thomastk@prodigy.net>
        email: requesting read receipt <admin@mickyemoose.net>
    Re: email: requesting read receipt <wyzelli@yahoo.com>
    Re: email: requesting read receipt (Tony L. Svanstrom)
    Re: Hmmm... Which PERL Book Is Best Suited For This??? (---Pete---)
    Re: Hmmm... Which PERL Book Is Best Suited For This??? (---Pete---)
    Re: Need help with this syntax? <wyzelli@yahoo.com>
    Re: Need help with this syntax? (Tad McClellan)
    Re: Print "tar" Success or Failure <whataman@home.com>
    Re: Problem using Archive::Zip <tfbiv@SPAMMENOTerols.com>
        Replacing spaces in a url with %20 <grimrob@ukrivals.net>
    Re: Replacing spaces in a url with %20 <wyzelli@yahoo.com>
    Re: Replacing spaces in a url with %20 <Xe96XmaniX@yahoo.dk>
    Re: require'ing OO modules on the fly - any danger? <djberg96@hotmail.com>
    Re: require'ing OO modules on the fly - any danger? <rick.delaney@home.com>
    Re: require'ing OO modules on the fly - any danger? <djberg96@hotmail.com>
    Re: Running another perl script from a script? <thomastk@prodigy.net>
        win32 perl debugger does not restart correctly <cs61b-tf@cory.eecs.berkeley.edu>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sun, 25 Mar 2001 23:13:24 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Basic socket logic (server) discussion...
Message-Id: <x7puf5zbl7.fsf@home.sysarch.com>

>>>>> "w" == wdstaff  <lafondd@sympatico.ca> writes:

  w> hey peeps,

i am not a peep.

  w> so here's the thing that HAUNT me days & nights...

so you bring your nightmare here?

  w> Imagine that there is 3 users connected to the server.
  w> USER1  is sending some data to server,
  w> USER2  is sending some data to server too.

  w> USER3  is not doing nothing,

double negative.

  w> the rules are when a USER send data to server, we must send back this data
  w> to every USERS.

how can you describe this accurately when you don't even use the proper
plural form?

  w> SO:
  w> USER1 finish to send its data and we must send this data to every existing
  w> users.

english please.

  --> But USER2 is sending some data to the server. <--
  --> But USER2 still sending some data while USER1 is finish  <-- said twice!
  w> really important!

why? programs can send and receive data at the same time. it is very common.

  w> So were able to send data to USER1,USER3 but not USER2.
  w> so we send to USER1 and USER3.
  w> but hey!!!!!!
  w> we CANNOT just not send data from USER1 because USER2 is already doing
  w> something!

that is mud.

  w> we ABSOLUTELY need to send data from every USERS to ANY USERS!!!!

plural problems again.

  w> how can it be possible to send the data from USER1 (to every users) if the
  w> socket of USER2 is already in use?

where did you learn about sockets? where did you get this idea that they
are half-duplex (which is what you seem to be saying)?

  w> experience required.......(guru)

pay required. i already have the experience.

  w> P.S.: you think you have enough skills to complete this? .....

sure i do. i have done this kind of stuff for 20 years. 

  w> go ahead and write the SERVER code...

i did. you want it in PDP-11 assembler? in a voice response client
server system? as the heart of a major web crawler? as the guts of Stem?

in fact stem has a chat server demo which does exactly that (but in a
clear way). i don't think i will let you see it though.

  w> Credits and every infos you'd like will be incorporated to our final
  w> application. (Flash5 project)

wow. i need more credits to graduate. how many do i get for this?

  w> EMAIL ME BEFORE YOU MAKE A MOVE!

i am not moving. i like where i live.

  w> details you must know before writing the code
  w> webdreamers2k@hotmail.com

hmm, a major project and you don't even have a proper domain or email
address.

  w> Please be fast....as we kinda have timelimit problems.. and we must
  w> test your work.

i don't think you can handle testing something you can't even clearly
describe.

and we must see your bank account. i will send you wiring
instructions. you wire a large sum of money and i may help you out. 

but since you sound like a student, i don't think you have the money.
real projects have domain names, better descriptions, and someone who
can express them in decent english.

so i don't think i will help.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Fri, 23 Mar 2001 16:37:05 -0600
From: "Thomas Theakanath" <thomastk@prodigy.net>
Subject: Re: Basic socket logic (server) discussion...
Message-Id: <99m2tc$2dc6$1@newssvr06-en0.news.prodigy.com>

are you looking for free code? or plan to pay? either way, i think this is
not the forum to advertise, i guess.

wdstaff <lafondd@sympatico.ca> wrote in message
news:pzsv6.457933$f36.14534686@news20.bellglobal.com...
> hey peeps,
> so here's the thing that HAUNT me days & nights...
> ______________
>
> Imagine that there is 3 users connected to the server.
> USER1  is sending some data to server,
> USER2  is sending some data to server too.
> USER3  is not doing nothing,
>
> the rules are when a USER send data to server, we must send back this data
> to every USERS.
>
> SO:
> USER1 finish to send its data and we must send this data to every existing
> users.
> --> But USER2 is sending some data to the server. <--
> --> But USER2 still sending some data while USER1 is finish  <-- said
twice!
> really important!
>
> So were able to send data to USER1,USER3 but not USER2.
> so we send to USER1 and USER3.
> but hey!!!!!!
> we CANNOT just not send data from USER1 because USER2 is already doing
> something!
> we ABSOLUTELY need to send data from every USERS to ANY USERS!!!!
> how can it be possible to send the data from USER1 (to every users) if the
> socket of USER2 is already in use?
>
> experience required.......(guru)
>
> P.S.: you think you have enough skills to complete this? .....
>         go ahead and write the SERVER code...
>        Credits and every infos you'd like will be incorporated to our
final
> application. (Flash5 project)
>
> EMAIL ME BEFORE YOU MAKE A MOVE!
> details you must know before writing the code
> webdreamers2k@hotmail.com
>
> Please be fast....as we kinda have timelimit problems.. and we must test
> your work.
>
>
>
>
>




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

Date: Fri, 23 Mar 2001 16:27:42 -0600
From: "Thomas Theakanath" <thomastk@prodigy.net>
Subject: Re: Can Someone Explain This, Please?
Message-Id: <99m2bn$21da$1@newssvr06-en0.news.prodigy.com>

I think, you get returned the number of successful matches. If you use,
array @digits instead of $digits, you will get the matches, and @digits[0]
might be the value are you are looking for.

Tom Hoffmann <tom.hoffmann@worldnet.att.net> wrote in message
news:slrn9bqeks.ls.tom.hoffmann@localhost.localdomain...
> Quite often I want to do a substitution in a string while preserving
> the original value, so I do:
>
> $string = 'This is a 4321 string';
> $digits = $string;
> $digits =~ s/.+?(\d+).+/$1/;
> print "STRING=$string\n";
> print 'DIGITS=$digits\n";
>
> to get:
> STRING=This is a 4321 string
> DIGITS=4321
>
>
> I found in the Cookbook that I can combine this as:
>
> ($digits = $string) =~ s/.+?(\d+).+/$1/;
> print "STRING=$string\n";
> print 'DIGITS=$digits\n";
>
> to get:
> STRING=This is a 4321 string
> DIGITS=4321
>
> Okay, great. However, if I eliminate the parenthesis:
>
> $digits = $string =~ s/.+?(\d+).+/$1/;
> print "STRING=$string\n";
> print 'DIGITS=$digits\n";
>
> I get:
> STRING=4321
> DIGITS=1
>
> I understand why $string gets reset to '4321', but why does $digits get
> set to '1', and not '4321'?




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

Date: Sun, 25 Mar 2001 17:47:48 -0600
From: "JD Lampard" <admin@mickyemoose.net>
Subject: email: requesting read receipt
Message-Id: <phvv6.56241$G72.1971758@e420r-atl1.usenetserver.com>

I have a perl (CGI) script which automatically generates an email that is
sent to visitors who fill out a "contact" form on my website.  Another copy
is sent to me for acknowledgement... this copy actually contains the
visitor's email address as the "From:" address.  How do I go about
requesting a read receipt on the email I receive, so that when I read it the
user's will get acknowledgement that the email was read.  Make sense?  Feel
free to email responses directly.

Many thanx!

Regards,
JD Lampard





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

Date: Mon, 26 Mar 2001 09:39:58 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: email: requesting read receipt
Message-Id: <8Bvv6.2$sy1.3021@vic.nntp.telstra.net>

"JD Lampard" <admin@mickyemoose.net> wrote in message
news:phvv6.56241$G72.1971758@e420r-atl1.usenetserver.com...
> I have a perl (CGI) script which automatically generates an email that
is
> sent to visitors who fill out a "contact" form on my website.  Another
copy
> is sent to me for acknowledgement... this copy actually contains the
> visitor's email address as the "From:" address.  How do I go about
> requesting a read receipt on the email I receive, so that when I read
it the
> user's will get acknowledgement that the email was read.  Make sense?
Feel
> free to email responses directly.

In clude the relevant field in the email... read the RFC...

Since this would apply regardless of the way the email was created, it
is not a Perl question.

Wyzelli
--
push@x,$_ for(a..z);push@x,' ';
@z='092018192600131419070417261504171126070002100417'=~/(..)/g;
foreach $y(@z){$_.=$x[$y]}y/jp/JP/;print;




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

Date: Sun, 25 Mar 2001 23:57:35 GMT
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: email: requesting read receipt
Message-Id: <1equtce.i4cyq4jfo5scN%tony@svanstrom.com>

JD Lampard <admin@mickyemoose.net> wrote:

> I have a perl (CGI) script which automatically generates an email that is
> sent to visitors who fill out a "contact" form on my website.  Another copy
> is sent to me for acknowledgement... this copy actually contains the
> visitor's email address as the "From:" address.  How do I go about
> requesting a read receipt on the email I receive, so that when I read it the
> user's will get acknowledgement that the email was read.  Make sense?  Feel
> free to email responses directly.

Wrong newsgroup... the CGI-NG would have been better, but still not
right, a mail-related NG best...

Anyhow, here's the answer, in Perl, insert it in the right place in your
existing script:

print 'Please reply so that I know you have read this e-mail!'


        /Tony
-- 
########################################################################
            I'm sorry, I'm sorry; actually, what I said was:
                  HOW WOULD YOU LIKE TO SUCK MY BALLS?
                             - South Park -


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

Date: Sun, 25 Mar 2001 23:59:07 GMT
From: bogus@erol.com (---Pete---)
Subject: Re: Hmmm... Which PERL Book Is Best Suited For This???
Message-Id: <3abe8403.23244234@news.earthlink.net>

On Sun, 25 Mar 2001 09:12:16 -0700, "bowman" <bowman@montana.com>
wrote:

>
>---Pete--- <bogus@erol.com> wrote in message
>news:3abe038a.104390085@news.earthlink.net...
>>
>> PS: Save this posting for the next one who
>> asks the same question <grin>.
>
>http://www.perl.com/reference/query.cgi?books
>
>would you believe this link addresses this question, with notes by a person
>who might know a little about Perl books?
------
Actually, the above link does not answer the question I originally
asked. The above link answers the question, what are *most* of the
books titles available for PERL & PERL/CGI. That's not what I was
looking for.  However, it's a good link worth bookmarking.

My specific needs were outlined in the original post and defiined
a certain level of expertise and a certain method of usage. This
thread also answers the question, of what books many in this 
newsgroup find most useful becasue some of the suggestions
were just their favorite choice of book.

---pete---



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

Date: Mon, 26 Mar 2001 00:16:48 GMT
From: bogus@erol.com (---Pete---)
Subject: Re: Hmmm... Which PERL Book Is Best Suited For This???
Message-Id: <3abe867d.23877921@news.earthlink.net>

On 25 Mar 2001 17:06:54 GMT, "Scott R. Godin"
<webmaster@webdragon.unmunge.net> wrote:

>"Programming Perl" by Larry Wall, Tom Christiansen, and Randal Schwartz 
>has been pretty much my 'bible' as far as that goes. I haven't picked up 
>too many others yet simply because I've been focusing my attentions on 
>specific aspects like DBI (for which I bought "Programming the Perl 
>DBI") and OO stuff (for which I picked up Damian Conway's excellent 
>"Object Oriented Perl") 
------
Upon reviewing all those books, it was a close race between
"Programming Perl" and "Mastering PERL 5". I thought that 
"Mastering PERL 5" was well organized, indexed best and the
type was larger making it easier on the eyes, but the
"Programming Perl" book won out becasue it was more detailed
and had more examples in the topics I was interested in.

>I must have read through PP about 7 times now, and as my knowledge grows 
>(you know the drill: skim the parts you can't understand clearly, and 
>keep reading til you finish. then try some stuff, and look up what you 
>need to.. then re-read the book again, and you'll find that some things 
>are now clearer and you skim less and less as time goes on... :), I've 
>found the book to be incredibly useful.
-------
I agree 100% with your methods above -- yeah, I do that too <grin>.
Something, I've always found to be true when learning just about
anything new is that it's best to get 3 books on the same topic
written by 3 different authors. No single author ever seems to
explain things 100%. When you read the same topic covered in 
3 different writing styles, it usually clears up any confusing issues.

---pete---



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

Date: Mon, 26 Mar 2001 09:46:35 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Need help with this syntax?
Message-Id: <QGvv6.4$sy1.3242@vic.nntp.telstra.net>

"Mark Johnson" <crvmp3@hotmail.com> wrote in message
news:907026CC9markjohnsononfiberco@24.28.95.186...
>
> I saw this in a perl script.  How do I read it?
>
> open(TR,"/usr/sbin/traceroute $host 2>&1|") || die "Error";
> while(<TR>) {
>   if ( $_ !~ /interface/i ) {
>     print;
>     print "<br>";
>   }
> }
>
> My question specifical is about the:
>
>  2>&1|

This has been in a couple of threads recently, and redirects STDERR

> and the
>
>   if ( $_ !~ /interface/i ) {

Each line returned will be in $_, if that does not match the word
'interface' then print the contents of $_.

>     print;
>     print "<br>";
>   }
>
>
> I understand that the script issues the traceroute command and
redirects
> the output to a file handle (TR) and then loops while not EOF on TR
and
> prints out each line, but I don't know the PERL way of saying this...

The program  opens a pipe to read the result of a traceroute to $host
with STDERR being redirected, then prints all lines which do not include
'interface', separated by <br>.

Wyzelli
--
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass
it around');
for(reverse(1..100)){$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n$_$a$s$b\n$t\n";
$_--;$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n\n";}print"$c*hic*";





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

Date: Sun, 25 Mar 2001 19:07:13 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Need help with this syntax?
Message-Id: <slrn9bt21h.5l4.tadmc@tadmc26.august.net>

Mark Johnson <crvmp3@hotmail.com> wrote:
>
>I saw this in a perl script.  How do I read it?
>
>open(TR,"/usr/sbin/traceroute $host 2>&1|") || die "Error";
>while(<TR>) {
>  if ( $_ !~ /interface/i ) {
>    print;
>    print "<br>";
>  }
>}
>
>My question specifical is about the:
>
> 2>&1| 


That is not a Perl question, that is a shell question.

That is the shell syntax for redirecting STDERR to go to wherever
STDOUT is going (merge the outputs).

You can even find the answers to (some) shell questions in the
Perl FAQ:

   perldoc -q STDERR

      "How can I capture STDERR from an external command?"

shows that shell syntax.


>and the
>
>  if ( $_ !~ /interface/i ) {


means: If the "line" does not contain "interface" then print stuff.

I think this is a little better:

   if ( ! /interface/i ) {

I think this is better yet:

   unless ( /interface/i ) {


>    print;
>    print "<br>";
>  }


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sun, 25 Mar 2001 23:33:41 GMT
From: "What A Man !" <whataman@home.com>
Subject: Re: Print "tar" Success or Failure
Message-Id: <3ABE80D1.FF16FB80@home.com>

Tad McClellan wrote:
> 
> BUCK NAKED1 <dennis100@webtv.net> wrote:
> >
> >> peter.sundstrom-eds@eds.com
> >> *All* Unix commands return a status
> >> code. They do *not* return nothing for
> >> success, they generally return 0.
> >
> >Thank You!!! That's one of the first things that I needed to know. Now
> >why didn't someone just say that as plainly as you did? :)
> 
> If you had asked what tar returns in a Unix newsgroup, someone
> probably _would_ have told you that.
> 
> tar is not Perl, so you should not expect help with tar in the
> Perl newsgroup.
> 
> Yet another good reason to ask questions in the right newsgroup :-)
> 
Yes, I'm aware that learning about tar is best discussed in a Unix
group. However, I really wasn't trying to learn about tar. If you
followed this thread closely, you should have noticed that my questions
weren't about how to use tar. They were about getting the correct Perl
coding to implement it's correct exit status, and how to get perl to
print success or failure. So, with all due respect, I think this was the
proper newsgroup.

Regards,
--Dennis


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

Date: Sun, 25 Mar 2001 19:10:01 -0500
From: Tom Bates <tfbiv@SPAMMENOTerols.com>
Subject: Re: Problem using Archive::Zip
Message-Id: <c32tbt46bprg2uvit35s8rrfqli6do4oj5@4ax.com>

Okay, thanks for the offer. Here is zipper.cgi and unzipper.cgi. (I
hope this uploads okay!)

Tom

On Sat, 24 Mar 2001 00:17:10 -0600 (CST), dennis100@webtv.net (BUCK
NAKED1) wrote:

>give us your code so we can troubleshoot.
>--Dennis


#-------------------------------------------------------------------------------
#
# zipper.cgi - executes zip operation
#
# Revision history:
# 3/23/01 TFBiv - original creation to overcome transmission errors on Comcast
#-------------------------------------------------------------------------------

  use lib "cgi-bin";                    # needed to find files on Comcast
  use CGI(":standard");                 # include CGI stuff
  use HTMLPrint;                        # include stuff for printing to HTML
  use Cwd;                              # for getting current directory
  use Archive::Zip qw(:ERROR_CODES);    # Zip functions

#
# Get CGI parameters.
#

  $dir = param("dir");                  # directory to work in
  $zipfile = param("zip");              # name of zip file
  $file = param("file");                # (optional) name of file to extract

#
# Bail out if required parameters are missing.
#

  die "Missing directory name\n" if not defined ($dir);
  die "Missing output zipfile name\n" if not defined ($zipfile);

  if (defined($file)) {                 # if file specified
    die "File $file not found\n" if not -f "$dir/$file";
  }

#
# Mention what the planned activity is.
#

  hprint sprintf "Adding %s in directory $dir to $zipfile\n",
                (defined ($file)) ? "file $file" : "all files";

#
# Switch to specified directory.
#

  dprint "Current directory is " . getcwd . "\n";
  chdir $dir or die "Could not change to specified directory: $!\n";
  dprint "Current directory is now " . getcwd . "\n";

  if ($DebugLevel > 0) {                # if debugging, show current files
    hprint "\nFiles in current directory:\n\n";
    foreach (glob("*")) { hprint "$_\n" }
  }

#
# Create the zip object.
#

  $zip = Archive::Zip->new();
  dprint "\n\nZip object $zipfile created\n";

#
# Add the file to the zip object.
#

  if (defined ($file)) {
    hprint "Adding $file\n";
    $m = $zip->addFile($file);
  } else {
    foreach $f (glob("*")) {
      hprint sprintf "Adding $f\n";
      $m = $zip->addFile($f);
    }
  }

  die 'Error write zip file' if $zip->writeToFileNamed($zipfile) != AZ_OK;

  hprint "Complete\n";

#-------------------------------------------------------------------------------
#
# unzipper.cgi - executes unzip operation
#
# Revision history:
# 2/10/01 TFBiv - original creation to overcome transmission errors on Comcast
#-------------------------------------------------------------------------------

  use lib "cgi-bin";                    # needed to find files on Comcast
  use CGI(":standard");                 # include CGI stuff
  use HTMLPrint;                        # include stuff for printing to HTML
  use Cwd;                              # for getting current directory
  use Archive::Zip qw(:ERROR_CODES);    # Zip functions

#
# Get CGI parameters.
#

  $dir = param("dir");                  # directory to work in
  $zipfile = param("zip");              # name of zip file
  $file = param("file");                # (optional) name of file to extract

#
# Bail out if required parameters are missing.
#

  die "Missing directory name\n" if not defined ($dir);
  die "Missing input zip filename\n" if not defined ($zipfile);

#
# Mention what the planned activity is.
#

  hprint sprintf "Extracting %s from $zipfile to directory $dir\n",
        (defined ($file)) ? "$file" : "all files";

#
# Switch to specified directory.
#

  dprint "Current directory is " . getcwd . "\n";
  chdir $dir or die "Could not change to specified directory: $!\n";
  dprint "Current directory is now " . getcwd . "\n";

  if ($DebugLevel > 0) {                # if debugging, show current files
    hprint "\nFiles in current directory:\n\n";
    foreach (glob("*")) { hprint "$_\n" }
  }

#
# Open the zip file.
#

  $zip = Archive::Zip->new();
  $status = $zip->read($zipfile);
  die "Read of $zipfile failed (status: $status)\n" if $status != AZ_OK;

  hprint "\n\nZip file $zipfile opened\n";

#
# Extract the file or files. If filename is specified, just extract that one
# file. Otherwise, extract all files.
#

  if (defined ($file)) {
    hprint "Extracting $file\n";
    $status = $zip->extractMember($file);
    die "Extraction from $zipfile failed (status: $status)\n" if $status != AZ_OK;
  } else {
    foreach $member ($zip->members()) {
      hprint sprintf "Extracting %s\n", $member->fileName;
      $status = $zip->extractMember($member);
      die "Extraction from $zipfile failed (status: $status)\n" if $status != AZ_OK;
    }
  }

  hprint "Complete\n";


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

Date: Mon, 26 Mar 2001 00:37:22 +0100
From: "grimrob" <grimrob@ukrivals.net>
Subject: Replacing spaces in a url with %20
Message-Id: <3abe82bc$1_2@news2.vip.uk.com>

This is a really simple question I am sure, but I cannot for the life of me
find the answer!

Any help greatly appreciated.

Rob
--
The Electronic Fishcake
http://www.electronicfishcake.com





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

Date: Mon, 26 Mar 2001 09:41:34 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Replacing spaces in a url with %20
Message-Id: <7Cvv6.3$sy1.3121@vic.nntp.telstra.net>

"grimrob" <grimrob@ukrivals.net> wrote in message
news:3abe82bc$1_2@news2.vip.uk.com...
> This is a really simple question I am sure, but I cannot for the life
of me
> find the answer!
>

s/ /%20/g

Wyzelli
--
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass
it around');
for(reverse(1..100)){$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n$_$a$s$b\n$t\n";
$_--;$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n\n";}print"$c*hic*";





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

Date: Mon, 26 Mar 2001 01:15:36 -0800
From: "mc" <Xe96XmaniX@yahoo.dk>
Subject: Re: Replacing spaces in a url with %20
Message-Id: <99m1sj$arr$1@sunsite.dk>

hi,
"grimrob" <grimrob@ukrivals.net> wrote in message
news:3abe82bc$1_2@news2.vip.uk.com...
> This is a really simple question I am sure, but I cannot for the life of
me
> find the answer!

something like this:

$urlWithSpaces = "http://www.some.www.net/index.pl?here you go and some more
of     it":
$urlWithSpaces =~ s/ /%20/g;
print $urlWithSpaces ;

gives what you aks for.






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

Date: Sun, 25 Mar 2001 23:10:07 GMT
From: "Daniel Berger" <djberg96@hotmail.com>
Subject: Re: require'ing OO modules on the fly - any danger?
Message-Id: <jVuv6.5057$pS2.225702@typhoon.mn.mediaone.net>


"Eric Bohlman" <ebohlman@omsdev.com> wrote in message
news:99lrkk$9lu$1@bob.news.rcn.net...
> Daniel Berger <djberg96@hotmail.com> wrote:
> > I'll need to look up the difference between eval "something" vs eval{
> > something }.  I honestly don't know the difference off the top of my
head.
> > Bad programmer....
>
> eval string is Perl's run-time compilation mechanism.  eval block is
> Perl's "try-catch" exception-handling mechanism.

Ok, I knew the latter, but wasn't sure about the former.  In this particular
case, it appears to work either way.

my $mod = "English";
eval "require $mod";
eval{ require $mod };

I'm not sure which of the two is "better".  Or is it merely preference?

Thanks.

Dan




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

Date: Mon, 26 Mar 2001 00:18:04 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: require'ing OO modules on the fly - any danger?
Message-Id: <3ABE8DFC.AFB1E3D6@home.com>

Daniel Berger wrote:
> 
> In this particular case, it appears to work either way.

What makes you say so?
 
> my $mod = "English";
> eval "require $mod";
> eval{ require $mod };
>
> I'm not sure which of the two is "better".  Or is it merely preference?

They are semantically different so you use the right tool for the right
job.  In either case you should check $@ to see if the eval succeeded.

Since you want to create the Perl code 'require English' and execute it
you want eval"string".  If you had 

    $mod = "English.pm";
                   ^^^
then you might want to use eval{code} to test whether the require
succeeded.

   eval { require $mod };
   if ($@) {
       warn "You can't use English names for Perl variables\n";
   }

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Mon, 26 Mar 2001 01:36:21 GMT
From: "Daniel Berger" <djberg96@hotmail.com>
Subject: Re: require'ing OO modules on the fly - any danger?
Message-Id: <p2xv6.5092$pS2.234096@typhoon.mn.mediaone.net>

"Rick Delaney" <rick.delaney@home.com> wrote in message
news:3ABE8DFC.AFB1E3D6@home.com...
> Daniel Berger wrote:
> >
> > In this particular case, it appears to work either way.

> What makes you say so?

A bad test script

>
> > my $mod = "English";
> > eval "require $mod";
> > eval{ require $mod };
> >
> > I'm not sure which of the two is "better".  Or is it merely preference?
>
> They are semantically different so you use the right tool for the right
> job.  In either case you should check $@ to see if the eval succeeded.

Sorry for the confustion - let me rephrase.  I could easily append ".pm" to
the string that is parsed.  Given that, should I

a) eval "require $mod"

or

b) $mod .= ".pm"; eval { require $mod };

Is there any reason to use one over the other (beyond one less operation)?

Dan






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

Date: Fri, 23 Mar 2001 16:10:53 -0600
From: "Thomas Theakanath" <thomastk@prodigy.net>
Subject: Re: Running another perl script from a script?
Message-Id: <99m1c2$4rce$1@newssvr06-en0.news.prodigy.com>

system("<the cmmand line to run perlscript2.pl>") should work.
the command line depends upon the OS and the PATH and privilege settings.

For example both command line "perl perlscript2.pl" and "./perlscript2.pl"
are possible on UNIX
with proper setups. If you don't know those, you might run into many other
similar problems later ;-)

D.J. Poot <djpoot@kabelfoon.nl> wrote in message
news:99j5ei$2oar$1@news.kabelfoon.nl...
> Hi there,
>
> I have a perl script from which I need to call another perl script, and
then
> return to the first one. (See below)
>
> ---Example---
>
> perlscript1.pl runs, prints some HTML...
> perlscript2.pl runs, prints some dynamic data...
> perlscript1.pl continues, finishes up the HTML and the scripts are both
> done...
>
> ---Example---
>
> I have been looking at the 'system()' call, but a simple "system
> '/perlscript2.pl';" doesn't seem to do anything, really. Therefore, I am
> asking you people now.. How can I run a perl script from another script?
>
> Thanks a lot in advance!
>
>
> Greetings,
> Dominique
>
>




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

Date: Sun, 25 Mar 2001 15:40:15 -0800
From: "David Liu" <cs61b-tf@cory.eecs.berkeley.edu>
Subject: win32 perl debugger does not restart correctly
Message-Id: <99lvii$91g$1@agate.berkeley.edu>

Hey,

My perl debugger on my win32 system doesn't seem to be working that well.
Specifically, I can''t restart a program with the 'R' command after it has
halted. Using cygnus, the debugger just locks up after I type the 'R'
command. Using the regular dos prompt, the rotates between the perl debugger
prompt and the command prompt. The command prompt accepts perl debugger
commands while the perldb prompt doesn't take any commands.

Here's the versioning information:

C:\>perl -v

This is perl, v5.6.0 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)

Copyright 1987-2000, Larry Wall

Binary build 613 provided by ActiveState Tool Corp.
http://www.ActiveState.com
Built 12:36:25 Mar 24 2000




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

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 V10 Issue 565
**************************************


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