[16323] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3735 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 18 14:05:40 2000

Date: Tue, 18 Jul 2000 11:05:23 -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: <963943522-v9-i3735@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 18 Jul 2000     Volume: 9 Number: 3735

Today's topics:
    Re: <newbie>How to determine current location (pwd) in  <dmeyers@panix.com>
        [NEW-B] Array comparisement <?@?.?>
    Re: [NEW-B] Array comparisement <sariq@texas.net>
    Re: accessing perldoc without having to telnet? (Abigail)
    Re: Attatchments from client cpoole@muskegon.k12.mi.us
        automating ms exchange server 5.5 ops... <psychoholic1213@yahoo.com>
    Re: bless loses inheritance? nobull@mail.com
        check for entries in an array <donaldwmonk@my-deja.com>
    Re: check for entries in an array <sariq@texas.net>
    Re: check for entries in an array (Malcolm Ray)
    Re: context confusion <dem@achilles.net>
    Re: convert string to real data. <aqumsieh@hyperchip.com>
        Converting from a String version of a date to epochseco cavenewt@my-deja.com
    Re: Converting from a String version of a date to epoch <sariq@texas.net>
    Re: Converting from a String version of a date to epoch <foo@bar.va>
    Re: Converting from a String version of a date to epoch <bart.lateur@skynet.be>
    Re: Extra Path Information in CGI <bart.lateur@skynet.be>
    Re: From Dropdown to Variable - How To? mandbinc@rocketmail.com
        globbing subdirectories <karpo@talk21.com>
        Help with Perl sockets! hurricane_number_one@my-deja.com
    Re: Help with Perl sockets! <care227@attglobal.net>
        How do you pass objects to a subroutine? <j_f9NOj_SPAM@yahoo.com.invalid>
    Re: How do you pass objects to a subroutine? <samay1NOsaSPAM@hotmail.com.invalid>
    Re: How do you pass objects to a subroutine? nobull@mail.com
    Re: how to convert "1.2.3.10" to "01020310"? (Craig Berry)
    Re: limits on GET <flavell@mail.cern.ch>
    Re: multiline & single line reqexp question nobull@mail.com
    Re: NET::SMTP sanity check please (Ben Coleman)
        Net:FTP problem... mangosi@my-deja.com
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 18 Jul 2000 13:52:10 -0400
From: David Meyers <dmeyers@panix.com>
Subject: Re: <newbie>How to determine current location (pwd) in CGIscript?</newbie>
Message-Id: <yob8zuzxr5h.fsf@panix6.panix.com>

"Jeff Susanj" <jeffrey.l.susanj@boeing.com> writes:

> This "Jeopardy Quoting" must be a perl thing because I have never heard
> anyone object to it in any other newsgroup.  I really hate to wade through a
> big long quote when I just read it in the last 10 replies.  The quote is a

Anyone who leaves in so much crap before getting to useful information
probably ought to be skipped anyway.  

> reference that I can look at if I need it.  Otherwise I know what the thread
> is about.  Worse, I hate to see someone blasted for something like that
> especially with no explanation (as I was in another Perl newsgroup that I
> never went back to).

If you've read this newsgroup for more than 10 minutes, you'll
have seen at least one explanation of it.

--d




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

Date: Tue, 18 Jul 2000 16:16:27 GMT
From: "Kliffoth" <?@?.?>
Subject: [NEW-B] Array comparisement
Message-Id: <vp%c5.408132$k22.1816323@flipper>

Lets say we got two arrays, we don't know the number of variables in them. I
need to compare the arrays; if ALL the variables in the first array are also
in the second array (and this second array may contain a lot more than just
the variables in the first array) it should do some stuff. If not, it should
die. I've been reading the perl-documentory for over an hour, and just can't
find it. If the answer is there, please tell me where it is, and sorry to
have waisted your time. Any help would be appreciated.
Thanx anyway, for taking the time to read posts of a newbie like me, I
appreciate it, alot!




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

Date: Tue, 18 Jul 2000 11:29:07 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: [NEW-B] Array comparisement
Message-Id: <397485D3.97884651@texas.net>

Kliffoth wrote:
> 
> Lets say we got two arrays, we don't know the number of variables in them. I
> need to compare the arrays; if ALL the variables in the first array are also
> in the second array (and this second array may contain a lot more than just
> the variables in the first array) it should do some stuff. If not, it should
> die. I've been reading the perl-documentory for over an hour, and just can't
> find it. If the answer is there, please tell me where it is

It's there.

perldoc -q intersection

> Thanx anyway, for taking the time to read posts of a newbie like me, I
> appreciate it, alot!

You're welcome.

- Tom


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

Date: 18 Jul 2000 11:54:47 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: accessing perldoc without having to telnet?
Message-Id: <slrn8n90ff.3do.abigail@alexandra.delanet.com>

Raphael Pirker (raphaelp@nr1webresource.com) wrote on MMDXIII September
MCMXCIII in <URL:news:8l1h18$cvt$12$1@news.t-online.com>:
}} 
}} Is there a way of accessing the perldoc without having to telnet? What do I
}} have to install/download?


perldoc comes with Perl! If you have Perl, you have perldoc. If you
don't have perldoc, you don't have Perl, but then, why would you
need perldoc?


Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


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

Date: Tue, 18 Jul 2000 13:00:09 -0400
From: cpoole@muskegon.k12.mi.us
Subject: Re: Attatchments from client
Message-Id: <39748D19.DA9FA395@muskegon.k12.mi.us>



"Mark W. Schumann" wrote:

> In article <39734FA5.D5D19471@muskegon.k12.mi.us>,
>  <cpoole@muskegon.k12.mi.us> wrote:
> >I have installed Mail::Sender by JENDA and it works well for
> >attatchments that reside on the server; however, what if I want to send
> >an attatchment from my client workstation?  Does anyone know of the
> >command I would use to to send a attatchment from my client workstation
> >(i.e. like a MS word file from my PC) or is there another module out
> >there which would be better for me to use.
>
> It depends.  If the Perl program is running on the "server" then your
> "client" probably isn't even visible to it.  Is this a CGI question
> in disguise?

Yes, this is a CGI question.  The CGI script is in Perl on our UNIX server
and we ned to send attatchments from the client, a users PC  using Netscape
Messenger.

>
> >I would appreciate any advice anyone can give me.  Thank You.
>
> First refine the question.  What happens when you try to send a file
> from your client PC?



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

Date: Tue, 18 Jul 2000 12:51:04 -0400
From: "psychoholic1213" <psychoholic1213@yahoo.com>
Subject: automating ms exchange server 5.5 ops...
Message-Id: <8l226j$kus$1@news.chatlink.com>

does any know how to add a new mailbox to ms exchange server 5.5, activate
it, and send out a welcome email?? any help would be useful...thanx




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

Date: 18 Jul 2000 17:46:43 +0100
From: nobull@mail.com
Subject: Re: bless loses inheritance?
Message-Id: <u9itu3perw.fsf@wcl-l.bham.ac.uk>

up2l8@my-deja.com writes:

> I am trying to reconsecrate an object into
> a new class (I'm trying to make a copy constructor...)
> but it seems that when I re-bless the object it loses
> all of the inheritance information.

Can you show us any code to illustrate this?  The code you include is
not complete so we can't run it and even if we could you don't say
what output you were expecting.  Futhermore, you appear to say that
code you cite illustrates an _unsuccessful_ attempt to reproduce the
problem.  If this really is the case even if we could run it and knew
what you were expecting it still wouldn't help.

Random-shot-in-the-dark: you forgetting that @ISA only lists immediate
parent classes not all ancestors.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Tue, 18 Jul 2000 16:46:54 GMT
From: magic monk <donaldwmonk@my-deja.com>
Subject: check for entries in an array
Message-Id: <8l21lo$uvu$1@nnrp1.deja.com>



How can I check all entries in an list before I push a scalar into it?
I want to do this in a loop so each iteration would add new entries to
the list.  My ultimate goal is to check to see if the scalar is in the
list before I push it into the list.  So, I won't have duplicate
entries in the list.

Can anyone help with this problem?

Thanks in advance.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 18 Jul 2000 12:05:01 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: check for entries in an array
Message-Id: <39748E3D.15CDF2A9@texas.net>

magic monk wrote:
> 
> How can I check all entries in an list before I push a scalar into it?

You mean an array, not a list.  See perlfaq4.

> I want to do this in a loop so each iteration would add new entries to
> the list.  My ultimate goal is to check to see if the scalar is in the
> list before I push it into the list.  So, I won't have duplicate
> entries in the list.

Use a hash instead of an array.

- Tom


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

Date: 18 Jul 2000 17:06:48 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: check for entries in an array
Message-Id: <slrn8n93l8.bp.M.Ray@carlova.ulcc.ac.uk>

On Tue, 18 Jul 2000 16:46:54 GMT, magic monk <donaldwmonk@my-deja.com> wrote:
>
>
>How can I check all entries in an list before I push a scalar into it?
>I want to do this in a loop so each iteration would add new entries to
>the list.  My ultimate goal is to check to see if the scalar is in the
>list before I push it into the list.  So, I won't have duplicate
>entries in the list.
>
>Can anyone help with this problem?

perldoc perlfaq4:

"How can I tell whether a list or array contains a certain element?"

Hint: you may find it better to change your design to use a hash rather
than a list.
-- 
Malcolm Ray                           University of London Computer Centre


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

Date: Tue, 18 Jul 2000 11:07:12 -0400
From: "Dave McIntyre" <dem@achilles.net>
Subject: Re: context confusion
Message-Id: <8l1rqb$ssq$1@bcarh8ab.ca.nortel.com>


"Abigail" <abigail@delanet.com.bbs@openbazaar.net> wrote in message
news:3bRRi4$U9o@openbazaar.net...

> Now, which number should "6A" be? The obvious answer is 6.

Not to belabor the point, but "6A" was exactly the error I was trying to
catch
(rather than being warned about). Why did the Perl gods, in their wisdom,
decide that "6A" should be converted to a number in numeric context rather
than just tossed out?  And when does it stop? Isn't it a bit of a stretch to
say that

$val="6thecatinthehatbythebathasarat";

should be converted to 6?

Dave




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

Date: Tue, 18 Jul 2000 15:57:38 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: convert string to real data.
Message-Id: <7apuobig7g.fsf@merlin.hyperchip.com>


Edward C Morgan <ecmorgan@lucent.com> writes:

> I have the following code:
> 
> %map=();
> $fh=IO::File->new("> foo");
> $map{$fh}=1;
> 
> The map now has a string "IO::File::GLOB(0x1234)"
> How do I convert this string back into the object?

You can't. Hash keys are converted to strings automatically. So, using a
blessed reference as a key will actually generate a key string that
happens to look like "IO::File::GLOB(0x1234)", but has no relation to
the reference what so ever.

My workaround is usually:

	$map{$fh} = $fh;

and then use the value, which is a scalar, and can hold references.

--Ala


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

Date: Tue, 18 Jul 2000 15:28:25 GMT
From: cavenewt@my-deja.com
Subject: Converting from a String version of a date to epochseconds
Message-Id: <8l1t20$rcl$1@nnrp1.deja.com>

I will have a number of strings of the form

Thu Oct 13 04:54:34 1994

These strings are 'harvested' from other text file sources.  I'd like
to be able to compare them.   How do I convert them to epochseconds?



I can't find a function to do it.  I can provide a time zone to
complete the definition.





--
http://www.nethole.com
With slashcode


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 18 Jul 2000 10:43:09 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Converting from a String version of a date to epochseconds
Message-Id: <39747B0D.B235E4E7@texas.net>

cavenewt@my-deja.com wrote:
> 
> I will have a number of strings of the form
> 
> Thu Oct 13 04:54:34 1994
> 
> These strings are 'harvested' from other text file sources.  I'd like
> to be able to compare them.   How do I convert them to epochseconds?
> 
> I can't find a function to do it.

Then you haven't looked hard enough.

perldoc -q epoch

Then, learn to fish.

perldoc perldoc
perldoc perl

- Tom


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

Date: Tue, 18 Jul 2000 17:46:11 +0200
From: Marco Natoni <foo@bar.va>
Subject: Re: Converting from a String version of a date to epochseconds
Message-Id: <39747BC3.31C92189@bar.va>


cavenewt,

cavenewt@my-deja.com wrote:
> I will have a number of strings of the form
> Thu Oct 13 04:54:34 1994
> These strings are 'harvested' from other text file sources.  I'd 
> like to be able to compare them.   How do I convert them 
> to epochseconds?

	$ perldoc Time::Local


	Best regards,
		Marco


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

Date: Tue, 18 Jul 2000 18:11:59 +0200
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Converting from a String version of a date to epochseconds
Message-Id: <ka09nsgu553118gleh8l1alpbns35cl14b@4ax.com>

cavenewt@my-deja.com wrote:

>I will have a number of strings of the form
>
>Thu Oct 13 04:54:34 1994
>
>These strings are 'harvested' from other text file sources.  I'd like
>to be able to compare them.   How do I convert them to epochseconds?

Well, if *you* can do the parsing, I can provide you with some info on a
standard module that can turn it into epoch seconds: Time::Local. It
contains the functions timelocal and timegm which are the inverse of
localtime and gmtime respectively. Obviously. ;-)

I bet it's on your system.

-- 
	Bart.


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

Date: Tue, 18 Jul 2000 18:05:20 +0200
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Extra Path Information in CGI
Message-Id: <tev8ns48a4anlo3gngnnagdif3ocrdcaii@4ax.com>

spurcell wrote:

>Does anyone know how this "extra Path info" is suposed to work? It makes
>sense how it works, but it don't work here.
>
>Config: IIS

Uh-oh. There's your problem.

For some reason, Microsoft's server refuses to work this way. MS
pretends that it's for "security reasons", that "you might give too much
away about your server directory tree structure". Totally bogus, since
the EXTRA_PATH info a user gives, NEED NOT BE RELATED to the actual
directory tree structure at all.

And what if it is.

If you're your own master, you can enable this mechaism. If you're not,
but depend on an ISP, well, you depend on his cooperation, but don't
expect too much.

	http://support.microsoft.com/support/kb/articles/Q184/3/20.asp


You can't do much sophisticated CGI cripting without this feature. Well:
I can't.

-- 
	Bart.


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

Date: Tue, 18 Jul 2000 17:06:07 GMT
From: mandbinc@rocketmail.com
Subject: Re: From Dropdown to Variable - How To?
Message-Id: <8l22pf$vvu$1@nnrp1.deja.com>

Your suggestion works, but I want to save the data the user selects to
the HTML form so that the next time someone retrieves the page, the new
data is shown.  Then, if someone else changes the value from the
dropdown list, the data is again saved to that same variable in the
same spot on the HTML page.

Don't I need PERL to do this?


> > On this SAME page there is a dropdown box where users can select
> > different text options.  I want to take the value they select and
move
> > it to some TEXT on a different part of the SAME HTML page (take it
to
> > the place where $help is).
>
> Unless it is acceptable that the page reloads when you select an
> option, this is not really the best situation to use Perl, IMO. In
> fact, you can't even call the perl script automatically without
> javascript (would require clicking a submit-button), so perhaps you
> should consider using pure javascript.
>
> > How do I then return that value (now assigned to $help) to the $help
> > variable in the TEXT on the SAME HTML page (with the SAME HTML file
> > name)?
>
> Assuming you get your script called with the value from the select
> pass in as a CGI parameter, you "merely" process the original HTML
> file, interpolating the variables you want replaced, outputting the
> altered page to stdout. I say "merely" because whereas it's relatively
> easy to do (I've written a module performing such interpolations, as
> they are indeed often used in larger, comlex CGI applications), it
> seems a lot of work for a simple application like this, which would,
> at any rate, be more user friendly if the page doesn't have to exit to
> a perl-script and reload a new version of the page. Hence:
>
> > Or if someone has a suggestion on an easier way to do this, please
let
> > me know.
>
> Well, the most obvious way if you want to avoid reloading and is OK
> with javascript is the totally dynamic version (requiring no Perl, so
> I hope ppl will bear with 10 lines off topic):
>
> <form name=3DMyForm>
> <select name=3DMyList onChange=3D"javascript:
>  document.MyForm.MyField.value =3D document.MyForm.MyList.options[
> document.MyForm.MyList.selectedIndex ].text;
> ">
> <option>First option</option>
> <option>Second option</option>
> <option>Third option</option>
> </select><P>
> <input type=3Dtext name=3DMyField>
> </form>
>
> This should do what you want. Hope this helps. :-)
>
>       ... /\/\\ads Orbesen Troest <mads@troest.NEVERMORE.dk>
>
> (Please remove NEVERMORE from address when replying via email...)
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 18 Jul 2000 18:02:02 +0100
From: "George Karpodinis" <karpo@talk21.com>
Subject: globbing subdirectories
Message-Id: <8l236c$3gh31$1@ID-41471.news.cis.dfn.de>

Is there any one-liner that can search and replace text in all files (*.tex
for example) of a directory AND its subdirectories ?

(I use Perl 5.6 on Win98)

Many thanks,
George




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

Date: Tue, 18 Jul 2000 15:10:55 GMT
From: hurricane_number_one@my-deja.com
Subject: Help with Perl sockets!
Message-Id: <8l1s1e$qgd$1@nnrp1.deja.com>

I'm pretty new to socket programming in Perl, so forgive me if this
sounds confusing.
I have an IP + port # of a machine that I want to download files from.
The machine is running a server software that does not support FTP or
HTTP. I have to use their own protocol to transfer files from the
server. I have a Perl script that can make the socket connection with
the server and exchange info with.
If I want to download a file, I make a request to download from the
server and the data is sent to my script. From there, I can store the
data that is transfered from the server into a local variable, which
gets written out to a file located on the machine running the Perl
script.
This is working fine. However, I want to be able to allow a user to run
the script from a web browser on a different machine. The script would
generate a "virtual" link to the file, which the user could click on to
download the file. When the user clicks on the link, it would start the
transfer, but I want the file to download to the user's computer, not
the server running the Perl script.
How can I do this? The data is being transfered from the server in which
the file originates to the server that is running the Perl script. How
can I have the script pop-up a donwload window in the user's browser and
transfer the contents to their hard drive? Is it possible? If so, could
someone suggest some example script that would allow me to figure this
out?



Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 18 Jul 2000 11:38:42 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Help with Perl sockets!
Message-Id: <39747A02.BE80EC2@attglobal.net>

hurricane_number_one@my-deja.com wrote:
>
> The script would
> generate a "virtual" link to the file, which the user could click on to
> download the file. When the user clicks on the link, it would start the
> transfer, but I want the file to download to the user's computer, not
> the server running the Perl script.
> How can I do this? The data is being transfered from the server in which
> the file originates to the server that is running the Perl script. How
> can I have the script pop-up a donwload window in the user's browser and
> transfer the contents to their hard drive? Is it possible? If so, could
> someone suggest some example script that would allow me to figure this
> out?

This isn't really related to sockets.  As you mentioned, the transfer 
is working fine.  You don't have a question about the socket stuff, 
you instead are asking about subsequently sending the created file 
to a user who is connecting with a browser.  With that in mind, this 
question is better suited to a CGI related group, such as:

comp.infosystems.www.authoring.cgi

Or maybe even an HTML group comp.infosystems.www.authoring.html, 
since getting a file via a browser is done as easily as: (space
added)

<a h ref="ftp://your.site.address/pub/filename">blah</ a>
    ^                                                 ^


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

Date: Tue, 18 Jul 2000 08:07:43 -0700
From: Frederic <j_f9NOj_SPAM@yahoo.com.invalid>
Subject: How do you pass objects to a subroutine?
Message-Id: <0cedc761.2f3a7522@usw-ex0102-014.remarq.com>

How do you pass a reference to an object to a subroutine?  I
created a new Net::FTP object ($ftp = Net::FTP->new
("some.host.name");) and I want to pass a reference to it to a
subroutine where it's going to be dereferenced.  How do I do
that?

Greetings,
Frederic




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

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com



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

Date: Tue, 18 Jul 2000 09:01:06 -0700
From: Samay <samay1NOsaSPAM@hotmail.com.invalid>
Subject: Re: How do you pass objects to a subroutine?
Message-Id: <14803e18.c3af3548@usw-ex0104-031.remarq.com>


use Obj
my $obj = Obj->new("arguments");
process($obj);


sub process {
  my $obj = shift;
  $obj->method();
  do whatever..
}



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

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com



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

Date: 18 Jul 2000 17:40:11 +0100
From: nobull@mail.com
Subject: Re: How do you pass objects to a subroutine?
Message-Id: <u9u2dnpf2s.fsf@wcl-l.bham.ac.uk>

Frederic <j_f9NOj_SPAM@yahoo.com.invalid> writes:

> How do you pass a reference to an object to a subroutine?

Exactly like any other argument, see perldoc perlsub.

> How do I do that?

Can you explain what you have tried and how it failed.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Tue, 18 Jul 2000 17:44:23 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: how to convert "1.2.3.10" to "01020310"?
Message-Id: <sn95rngk1nk55@corp.supernews.com>

Abigail (abigail@delanet.com.bbs@openbazaar.net) wrote:
: Where is this "intent" defined? Or is this arbirary, just as using
: tr/// to remove letters, and y/// to remove digits?

It is arbitrary to a degree; that's why I described it as "informal" and a
"convention".  Again, it falls into exactly the same category as
indentation of code; there are many potential styles, each with pluses and
minuses, and each with its devout defenders.  But I think we would all
agree that indented code, using any reasonable style, is far easier to
read (and hence maintain) than unindented code, despite the fact that perl
sees no difference between the two forms.

: But, for me, the intent of map is to mainly apply a function to each
: element of a list. Whether that function has a side effect or not is
: irrelevant. map {printf "%02d" => $_} @array couldn't be clearer.

Just as the intent of foreach is to apply a block to every element in a
list.  foreach can thus be seen as a subset of map, to a first
approximation.  Yet both get used in many programs, and not just in those
cases where foreach does offer features not available in map (e.g., next).
My argument is simply that there are good reasons for this choice.  And

  printf '%02d', $_ foreach @array;

is equally clear, surely.

: Reduction ad absurdem is an important, and often beautiful, technique
: when proving theorems. I wouldn't want to leave home without it.

When properly applied, yes.  Here, however, I'm not advocating a
theorem-like proposition, but rather, a flexible, informal approach to
coding.  Naturally it gets silly if pushed too far.

: -- I think perhaps you're picturing me coming to a screeching halt, jaw
: -- hanging slack as I stare dumbfounded at the interplation-free dquoted
: -- string.
: 
: That's how you describe yourself, yes. And complaining a FOUR character
: string which was double quoted only confirms that impression.

My complaint was largely ironic, a rimshot following the punchline
regarding map.

: --          It's more like a flash of mental setup followed instants later by
: -- a flash of self-correction.  I see e.g.
: --
: --   $foo = "Here's a very &//? long and sym&^bol-\$rich string blah blah!";
: --
: -- deep inside the program somewhere.  I can't grok that string all at once,
: -- so I prepare to scan it for stuff of interest.  Being double-quoted, I'm
: -- looking for the whole family of escapes, plus interpolations.  At the same
: -- time, I'm forming hypotheses about what $foo might be used for just below,
: 
: Really? I'd say that if you need to analyze the content of a string to see
: what it is being used for, something is wrong. Context, variable name, or
: even comment should make it clear.

Big gap between 'should' and 'does' in actual practice, I find.  All of
these help, of course, but often you need to examine the string text
itself to complete the picture.

: I also find it utterly amazing that while someone can't grasp the
: string
: 
:     "Here's a very &//? long and sym&^bol-\$rich string blah blah!",
: 
: all at once, he apparently *can* grasp
: 
:     'Here\'s a very &//? long and sym&^bol-$rich string blah blah!'
:  
: all at once. After all, if one can't, it would not matter what quotes are
: used, would it?

When parsing the latter one, all I need to look for are a couple of
backslash cases, period.  Much simpler.

: Me, I would look at the first string, see there's no interpolation
: going on, so I wouldn't care at all what the quotes are. As for the
: single quotes form, I'd probably think "hmmm, $rich isn't a variable,
: oh, that's ok, it's single quoted anyway".

Yeah, and there go a precious few milliseconds. :)

: You picked an interesting example as "counter argument", as the funny
: string contains a single quote.

True.  If there were more than one, or it were Thursday, I might have
chosen q() instead.

: Tell me, which of your arguments you use to promote single quotes when no
: interpolation takes place, while reserving double quotes only when there's
: interpolation, doesn't apply to s///?

Honest answer?  Force of habit and others' convention.  I've been writing
substitutions long enough in the standard form, and read enough code using
that form, that it's easier to leave the dquote context than to do the
"right thing".  As I will now repeat again:  It's a matter of informal
convention and empirical eyeball-parsing optimization, *not* a rigid and
formally consistent rule set. 

-- 
   |   Craig Berry - http://www.cinenet.net/users/cberry/home.html
 --*--  "Beauty and strength, leaping laughter and delicious
   |   languor, force and fire, are of us." - Liber AL II:20


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

Date: Tue, 18 Jul 2000 16:54:48 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: limits on GET
Message-Id: <Pine.GHP.4.21.0007181654090.16078-100000@hpplus03.cern.ch>

On Tue, 18 Jul 2000, Keith Calvert Ivey wrote:

> "Alan J. Flavell" <flavell@mail.cern.ch> wrote:
> 
> >then you _could_ use CGI.pm's "excapeHTML" method:
> 
> I'm expecially disturbed to see this from you, Alan.

woops!  Nobody's purrfect.  Sorry.



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

Date: 18 Jul 2000 17:41:41 +0100
From: nobull@mail.com
Subject: Re: multiline & single line reqexp question
Message-Id: <u9og3vpf0a.fsf@wcl-l.bham.ac.uk>

vibrato@my-deja.com.bbs@openbazaar.net (Lance Hoffmeyer) writes:

> Whenever I add a regexp or another multiline regexp to this
> program the first multiline regexp quits working.

The /g is not the multiline qualifier.  Check the manual to see what
/g means - and in particular the strange things it does on a match in
a scalar context.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Tue, 18 Jul 2000 17:16:56 GMT
From: oloryn@mindspring.com (Ben Coleman)
Subject: Re: NET::SMTP sanity check please
Message-Id: <39749098.609574381@news.mindspring.com>

On 16 Jul 2000 0:27:31 +0200, "Rask Ingemann Lambertsen"
<postmaster@rask.nospam.kampsax.k-net.dk> wrote:

>They might be using POP-before-SMTP for authentication

Last I knew, not even that.  You're either in a network that's allowed
to send via mail.mindspring.com or you're not.  If you're connected
via mindspring, you have to use it(port 25 blocking). If you're not
connected via Mindspring, you can't use it.

Ben


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

Date: Tue, 18 Jul 2000 17:51:33 GMT
From: mangosi@my-deja.com
Subject: Net:FTP problem...
Message-Id: <8l25f6$do9$1@nnrp2.deja.com>

I just installed the Net::FTP module on a solaris
2.6 box. I tried using a simple script to test it
out, but I get this error:

Net::FTP: Net::FTP(2.56)
Net::FTP:   Exporter
Net::FTP:   Net::Cmd(2.18)
Net::FTP:   IO::Socket::INET(1.24)
Net::FTP:     IO::Socket(1.25)
Net::FTP:       IO::Handle(1.21)

Net::FTP: Unexpected EOF on command channel at ./
testit.pl line 5
Can't call method "login" on an undefined value at
 ./testit.pl line 6.


Any ideas what "command channel" refers to and how
I can fix this?

TIA,
Danny

---BEGIN testit.pl---
#!/usr/local/bin/perl -w

use Net::FTP;

$ftp = Net::FTP->new("128.155.200.120", Debug =>
1);
$ftp->login("myusername",'mypassword');
$ftp->cwd("/pub");
$ftp->put("test.file");
$ftp->quit;

exit(0);
---END testit.pl---


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 3735
**************************************


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