[6703] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 328 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 18 11:17:17 1997

Date: Fri, 18 Apr 97 08:00:21 -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           Fri, 18 Apr 1997     Volume: 8 Number: 328

Today's topics:
     [Update] Jacl -- Running Tcl Scripts inside Java (Ioi Lam)
     Re: Bug in Regexp? (Tad McClellan)
     Crypt() Question (Frank Fisher)
     Re: Good editor for W95? (rga)
     Re: Head of mail.... (Andrew Starr)
     Help running codse in an XTERM <allenm@lexis-nexis.com>
     Re: how to use a system-installed Perl w/locally downlo (Terrence M. Brannon)
     HPUX and flock() <jrmiddle@best.com>
     Re: httpd server for win95 <john9904@xensei.com>
     Re: is there a perl equivalent of which or whence? <rra@stanford.edu>
     Re: Last Update! (Mike Stok)
     Re: Mac version of Perl ... (Dave Giggy)
     Re: Mac version of Perl ... (Dave Giggy)
     Re: perl and multithreading (Richard S. Smith)
     Re: Puzzle: Count Actual Days from MM,DD,YYY to localti (rga)
     Re: Reply to Ousterhout's reply (was Re: Ousterhout and (Evan Kirshenbaum)
     Re: Simple Split Question (Andreas Karrer)
     Re: sorting a *file* (yeah, I know, it's a mainframe co (Matthew D. Healy)
     Sorting On Columns of an Array of Data Question (Frank Fisher)
     strange characters <pucko@lysator.liu.se>
     Re: Transliterate from a pattern? (Tad McClellan)
     Re: unreading a line of input (Terrence M. Brannon)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 17 Apr 1997 19:46:48 -0400
From: ioi@cs.cornell.edu (Ioi Lam)
Subject: [Update] Jacl -- Running Tcl Scripts inside Java
Message-Id: <5j6cp8$qt2@hoho.cs.cornell.edu>



  Jacl, pronunced "Jackal", is a Tcl interpreter written in Java. You
  can use it for Java the same way Tcl is used for C -- a scripting
  language to glue together modules written in a low level language.

  See http://www.cs.cornell.edu/home/ioi/Jacl for latest info and
  download.

  ======================================================================
  NEW>>                                                            <<NEW
  NEW>>                                                            <<NEW
  NEW>>    Now you can execute a Tcl script inside a web           <<NEW
  NEW>>    browser without having to install the Tcl               <<NEW
  NEW>>    plugin. Here is the first "Jaclet" ever                 <<NEW
  NEW>>    built. Check it out:                                    <<NEW
  NEW>>                                                            <<NEW
  NEW>> http://www.cs.cornell.edu/home/ioi/Jacl/demos/Buttons.html <<NEW
  NEW>>                                                            <<NEW
  NEW>>                                                            <<NEW
  ======================================================================

  BUGS: The applet seems to introduce 10 second delays in Netscape
  every time you reload it. Runs fine inside Internet Explorer.



        


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

Date: Thu, 17 Apr 1997 14:37:22 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Bug in Regexp?
Message-Id: <i5u5j5.br1.ln@localhost>

Bob Wilkinson (b.wilkinson@NOSPAM.pindar.co.uk) wrote:
: In article <33556BA9.FEB@ice-t.com.au>, hcurrie@ice-t.com.au wrote:

: > Hi there,
: > I have a scalar that has about 34k of text (html) in it. I run the
: > Regexp
: > $s =~ /<[ \t\n]*body([ \t\n][^>]*)?>((\n|.)*)<[ \t\n]*\/body[ \t\n]*>/i;
: > over it, and $2 which I expect to have the body of my html document in
: > it,
: > retrns '2' if I cut out some of the source file, everything works well.
: > (30k seems fine.) Is this a bug? Does Perl have a limit on the size of
: > data 
: > it can process with Regex? Can anyone suggest a workaround? 
: > 

: From the BUGS section of "man perl"

: A regular expression may not compile to more than 32767 bytes internally.

: I think that this is what you are seeing.


I don't know, but I'd guess that that is not the problem.

That regex doesn't look like it should grow too big.

There is a limit on the size of the compiled regex, not on the
string being searched.

His string is big, but not his regex...




--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Fri, 18 Apr 1997 00:46:45 GMT
From: frank@primemail.com (Frank Fisher)
Subject: Crypt() Question
Message-Id: <3356c444.1412684@nntp.a001.sprintmail.com>

Why does the crypt() function only use the first 8 characters?  Is
there any way to encrypt more than 8 characters?

--frank



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

Date: Thu, 17 Apr 1997 22:51:59 GMT
From: rga@io.com (rga)
Subject: Re: Good editor for W95?
Message-Id: <3356a94b.1780102@news.io.com>


netkid@netcom.com wrote:


>An Ascii FTP transfer should handle the CRLF to LF translation correctly.
       ^^^^

	Works for me !
	Using any ASCII editor in Windows95
	Make sure, as mentioned, to use ASCII transfer



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

Date: Thu, 17 Apr 1997 00:51:43 -0400
From: atstarr@seebelow.edu (Andrew Starr)
Subject: Re: Head of mail....
Message-Id: <atstarr-1704970051440001@ppp2.negia.net>

In article <5j2nu5$60h$1@talos4.risc.sps.mot.com>, kumar@adtaz.sps.mot.com
wrote:

> Hi All,'
> 
>         I am trying to send an email to someone with some web site addresses.
> I also want to create links to thosse websites, so that while the person is
> reading my email, all he has to do is to click on them and he can go
> to those websites. Do I need to write a perl script for that. If so  how do I
> do it. If this question has nothing to do with PERL, please let me know
> where I can post this mail
> 
>         Thank you for your help
> REgards
> Kumar

I don't know Perl yet, but I imagine that this has to do not so much with
Perl, but with what mail reader your recipient is using.

I.e. if they are using Eudora 3.x (Pro or Light, Mac or Win), just send
the URL in the message. Netscape should recognize plain old URLs. Other
mailers may or may not.   But if not, I don't see how you can force it to;
presumably your Perl script controls your local mailer; your recipients
e-mail program controls receipt of the text-based message.

-Andrew

-- 
Andrew Starr
atstarr at amherst.edu
http://www.amherst.edu/~atstarr/eudora (for Eudora utils. and info)
I have no connection to Qualcomm other than being a happy customer!
If this post/email is answering a help request, please try to post
  followup questions, esp. new questions, to the newsgroup. Thanks.


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

Date: Thu, 17 Apr 1997 18:46:19 -0400
From: Allen May <allenm@lexis-nexis.com>
Subject: Help running codse in an XTERM
Message-Id: <3356A83B.37E@lexis-nexis.com>

OKAY..  I've asked this question before but I didn't get much of
a response...  Let me try explaining this a little clearer.

I want to create a perl script that will launch an xterm window
and run perl code inside the new xterm window.  I want to do
this "all inclusive".  Currently I have two scripts to run one
application.. The first script, foo1, launches the second
script, foo2. So, from a command line a type foo1 and this is
what it does:

   system ("xterm -g =60x20+350+88 -ut +sf -e foo2");

Where `foo2' is the actual program..
I thought perl would have some functionality that would allow this
to be all inside the same code.

If more info is needed to give advice, please let me know.. I really
wanna figure this out.

Thanks

-Allen

     +---------------------------------------------------------------+
     |                                                 ____       _  |
     |Allen H. May                                   |__\_\_o____/_| |
     |LEXIS-NEXIS Help Desk Engineer	            <[___\_\_-----<  |
     |email - Allen.May@lexis-nexis.com              |  o'           |
     |		                                                     |
     +---------------------------------------------------------------+


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

Date: 17 Apr 1997 17:05:15 -0700
From: brannon@bufo.usc.edu (Terrence M. Brannon)
To: Nathan Torkington <gnat@elara.frii.com>
Subject: Re: how to use a system-installed Perl w/locally downloaded modules
Message-Id: <ysizzpuxrya1.fsf@bufo.usc.edu>

I know you guys put in a lot of time to give us beginners a bunch of
well-structured documents, but is it possible to allow us to search
the CPAN various documents (FAQs, FMTYEWTK, DSC) via Webcrawler or
something similar?

Nathan Torkington <gnat@elara.frii.com> writes:

> You mean, like:
> 
> http://www.perl.org/CPAN/doc/manual/html/pod/perlfaq8/How_do_I_instal_a_CPAN_module_.html
> 
> and
> 
> http://www.perl.org/CPAN/doc/manual/html/pod/perlfaq8/How_do_I_kep_my_own_module_libr.html
> 
> ?
> 
> Nat

-- 
o============o  Sending  unsolicited commercial e-mail (UCE) to this address
 Legal Notice   is indication of your consent to pay me $120/hour for 1 hour
o============o  minimum for professional proofreading & technical assessment.
terrence brannon * brannon@kappa.usc.edu * http://rana.usc.edu:8376/~brannon


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

Date: Thu, 17 Apr 1997 17:19:44 -0700
From: Justin Raut-Middleton <jrmiddle@best.com>
Subject: HPUX and flock()
Message-Id: <Pine.SGI.3.95.970417171211.18569A-100000@shellx.best.com>

Has anyone used flock() on HPUX? A friend of mine is trying to run a script
I wrote which uses it; it works fine on Linux and OSF, but on HP it chokes
and dies. I do not have the exact error message, so forgive me if I am not
affording enough information.

The person running the script talked to an HP engineer, who said to use
fcntl() instead. However, in the camel, it is stated that flock() will be
emulated with fcntl() by perl if found. Any ideas why this would not take
place? 

I'm having this person re-build perl on the machine in question to make
sure that no warnings are being emitted at build time. In the meantime,
however, would anyone happen to have a better (or at least more direct)
answer?

thanks,

/justin

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Justin R. Middleton
415-550-4066
15 Red Rock Way N-109
San Francisco, CA 94131
justin@bigpants.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=




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

Date: Thu, 17 Apr 1997 20:55:03 -0400
From: Joe Johnston <john9904@xensei.com>
Subject: Re: httpd server for win95
Message-Id: <3356C667.25A0@xensei.com>

Goce Dimitroski wrote:
> 
> where can i get a httpd server for win95 so that i can test out my cgi
> stuff ?
Try www.shareware.com. I use ohttpd. I think it's better, if you've got
the time(who has?), to install a free unix on your machine. The
documentation and developement seems MUCH easier in a unix environment.

Then again, I know professional developers who use perl for NT. Go
figure.

-- 
-
Joe Johnston	
john9904@xensei.com
http://www.xensei.com/users/john9904


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

Date: 17 Apr 1997 16:48:41 -0700
From: Russ Allbery <rra@stanford.edu>
To: jte@maps-r-us.com
Subject: Re: is there a perl equivalent of which or whence?
Message-Id: <qumzpux5hye.fsf@cyclone.stanford.edu>

[ Posted and mailed to original poster. ]

Tom Christiansen <tchrist@mox.perl.com> writes:
> In comp.lang.perl.misc,  Yash Khemani <jte@maps-r-us.com> writes:

>> is there a perl equivalent of whence or which?

> foreach $file (@ARGV) {
>     for $dir (split(/:/,$ENV{'PATH'})) {
> 	print $path,"\n" if -f ($path="$dir/$file") && -f _;
>     } 
> }

I'm pretty sure that C<-f _> was supposed to be C<-x _>.

For a slightly fuller version, see
  <URL:ftp://ftp.eyrie.org/pub/software/shell/which>

-- 
Russ Allbery (rra@stanford.edu)         <URL:http://www.eyrie.org/~eagle/>


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

Date: 17 Apr 1997 23:34:55 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Last Update!
Message-Id: <5j6c2v$p@news-central.tiac.net>

In article <33565A3F.53FF@ein.ericsson.se>,
Zaheed Haque  <zaheed.haque@ein.ericsson.se> wrote:
>Hey,
>
>I apologize for this stupid questions.. But please help!
>Does anyone aware of any script that can go to an 
>external website and check for the last update date on 
>specific HTML pages and prints out the output.. for example 
>
>1. Check the following URL http://a.com/b/c.html
>2. If the todays date is same as the document update date then print
>something to a file ...
>
>Hopefully you all will share your experince and or tell us
>what way we can solve this problem ..

#!/usr/local/bin/perl -w

use LWP::UserAgent;

$agent = new LWP::UserAgent;
$request = new HTTP::Request 'HEAD' => 'http://www.stok.co.uk/~mike/';

$response = $agent->request ($request);

print $response->header ('last-modified'), "\n" if $response->is_success;

__END__

might be a starting point if you have perl 5 and the libwww-perl modules.
Both of these can be found on CPAN, the Comprehensive Perl Archive Network
accessible at

  http://www.perl.com/CPAN/
  ftp://ftp.funet.fi/pub/languages/perl/CPAN/

Hope this helps,

Mike
-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: Thu, 17 Apr 1997 17:02:13 +0100
From: gig@znet.com (Dave Giggy)
Subject: Re: Mac version of Perl ...
Message-Id: <gig-1704971702130001@capts-34.znet.com>

OOPS... forgot the URL which is:

         http://www.unimelb.edu.au/~ssilcot/macperl-primer/home.html

gig


>
>Where (FTP sites etc) can I get a Mac version
>of perl. 
>
>BTW I am using a Mac SE, I dont think its using 
>system 7 (Its been so long since Ive powered it
>up !!!)
>
>


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

Date: Thu, 17 Apr 1997 16:59:00 +0100
From: gig@znet.com (Dave Giggy)
Subject: Re: Mac version of Perl ...
Message-Id: <gig-1704971659010001@capts-34.znet.com>


In article <5j5sjo$nil@bmerhc5e.bnr.ca>, brodger@bnr.ca >Where (FTP sites
etc) can I get a Mac version
>of perl. 
>
>BTW I am using a Mac SE, I dont think its using 
>system 7 (Its been so long since Ive powered it
>up !!!)
>
The best way to get started with MacPerl is via some of the good net sites
such as Sandra Silcot's dandy "MacPerl Primer" which has all the links you
will need to start plus lots of good info.

However--     lotsa luck on a non sustem 7+ SE


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

Date: Thu, 17 Apr 1997 22:51:53 GMT
From: rsmith@netcom.com (Richard S. Smith)
Subject: Re: perl and multithreading
Message-Id: <rsmithE8t0uH.IF1@netcom.com>

I want to thank the people who replied to my query.  I know a lot more
about threads now than I did 24 hours ago...

This thread (is this word overloaded? ;-) raises some interesting
questions...

1.  When 5.005 comes out, will there be a call like fork() to create
    threads?  I've heard that some implementations use a clone() call.

2.  Will Solaris users be able to choose Solaris threads over Posix during
    the installation process?

3.  Will it be up to the Perl programmer to deal with things like mutex
    locks or will the Perl implementors find a clever abstraction to hide
    them behind?  (Or both?)

4.  Will it be transparent across Unix<-->NT? (That would be a major win!)

5.  What about debugging?

It looks like as of now there is no language other than C/C++ that gives
people robust access to threading.  Python sort of does it if you are
clever and keep up with all the latest traffic on comp.lang.python.  

Java suppossedly does it, except it seems to me that you are threading
within the "java virtual machine" which would tend to negate the
performance gains that threads buy you.

Stuff to think about, I guess.  Again, thanks to everyone who helped.

--
+--------------------------------------------------------------------+
| Richard S. Smith / rsmith@netcom.com / http://www.captech.com/~rss |
| Progress(tm) 4gl v[678] Developer/DBA / Los Gatos, California, USA | 
| The PROGRESS FAQ --> http://www.captech.com/~rss/progress-faq.html |
+--------------------------------------------------------------------+


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

Date: Thu, 17 Apr 1997 23:00:58 GMT
From: rga@io.com (rga)
Subject: Re: Puzzle: Count Actual Days from MM,DD,YYY to localtime(time) - REQ: Easier Way
Message-Id: <3356aaa8.2129535@news.io.com>

Tom Christiansen <tchrist@mox.perl.com> wrote:

>I suppose you'd like us to built that functionality
>into the perl core binary, since you aren't allowed
>to use modules? 


Actually, when I started reading perl, I looked for it,
couldn't find it, then of course learned about modules.

I guess the module is the best way to go, I was just
thinking that someone already had a short line or two
that would do this.  Since, when I set out to make a short
line or two I only came up with this elaborate looping effort.

Sincerely, RGA


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

Date: 17 Apr 1997 22:51:34 GMT
From: evan@poirot.hpl.hp.com (Evan Kirshenbaum)
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <5j69hm$p4f@hplms2.hpl.hp.com>

In article <5j2p70$hj0@news.istar.ca>,
Hume Smith <hclsmith@tallships.istar.ca> wrote:
>"everything as strings" is convenient because in most languages,
>programs actually exist as a string at some stage - as their original
>source code.  tcl goes through a minimum of fuss converting source to
>internal form.

If you want a minimum of fuss, use TECO (the original implementation
language for EMACS).  No parsing involved.  *Every* character is an
operator or part of data:

  ! detab routine - ts at 4 or 8 spaces depending upon EZ&4 !
  @^UD]8UTEZ&4"N4UT'0J<:@S/	/;.UA0LQA-.UBQB/QT*QTUCQB-QCUCQAJ-D@I/ /
  QC"NQT-QC<@I/ />'>]@^UX/0JHXRHEQHK1XQ ZJ543HZPRHKG#/QZ&512"NMX0J'
  0uz

No, that's not line noise. :-)  Yes, people actually wrote in this
language.  By hand.

-- 
Evan Kirshenbaum                       +------------------------------------
    HP Laboratories                    |"Revolution" has many definitions.
    1501 Page Mill Road, Building 1U   |From the looks of this, I'd say
    Palo Alto, CA  94304               |"going around in circles" comes
                                       |closest to applying...
    kirshenbaum@hpl.hp.com             |           Richard M. Hartman
    (415)857-7572

    http://www.hpl.hp.com/personal/Evan_Kirshenbaum/


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

Date: 17 Apr 1997 22:51:41 GMT
From: karrer@ife.ee.ethz.ch (Andreas Karrer)
Subject: Re: Simple Split Question
Message-Id: <slrn5ldac1.6pl.karrer@kuru.ee.ethz.ch>

In article <33567181.1CFB@FL.ENSCO.COM>, Jeff Etrick wrote:
>I have a variable that is set to 0.0, I would like to parse this
>into two variables, but the split function always treats the variable
>as a float. How do I tell perl to treat this as a string?
>
>Ex:
>
>my $STRTIM  =  0.0;
>($H, $M) = split/\./,$STRTIM;

$STRTIM is treated as an integer, not a float. perl tries to handle numbers as 
whole numbers as long as possible, and only resorts to floats if it needs to.
It doesn't matter if you say

  my $STRTIM  = 0;
  my $STRTIM  = 0.;
  my $STRTIM  = 0.0;
  my $STRTIM  = 0.00;
  my $STRTIM  = -0.0000e-3;

Since these don't start with quotes, perl interprets them as 
numbers. perl finds out that the value is exacly 0, and uses the integer
representation. If that value is later evaluated in a string context,              
it is converted to the string "0".

  my $STRTIM  = '0.0';
   
is different, of course.
   
 - Andi


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

Date: Thu, 17 Apr 1997 19:00:55 -0500
From: Matthew.Healy@yale.edu (Matthew D. Healy)
Subject: Re: sorting a *file* (yeah, I know, it's a mainframe concept)
Message-Id: <Matthew.Healy-1704971900550001@pudding.med.yale.edu>

In article <slrn5l6vnd.bep.bet@waltz.rahul.net>, bet@network.rahul.net
(Bennett Todd) wrote:

> As soon as the amount of data grows
> to make you start paging, you have to use external files, and at that point
> the Unix sort(1) program is the way to go. So if you expect to grow to large
> amounts of data within the life of this program, go ahead and start with
> sort(1) now.

I quite agree.  There are a lot of extra wrinkles to sorting once you
get beyond what fits into RAM, because then you have more variables to
optimize than just the number of comparisons.  Once you start paging
to disk then in order to avoid thrashing that disk you need to do things
like divide up into chunks, sort each chunk, then merge the chunks, etc.

The sort program that comes with Unix ain't perfect, but it's much better
than anything you or I would be likely to devise without spending a hell
of a lot of time on it.

For a look at something more amusing, take a look at Knuth's chapter on
tape-oriented sorting routines, where you have several tape drives and
no random-access device big enough to hold your data.  Fortunately,
_that_ is far less common in this age of cheap multiple-gig disk drives!
---------
As of 17 Apr 1997, 988 days till Y2K....
Matthew.Healy@yale.edu
http://paella.med.yale.edu/~healy
"But I thought it was pointed at the rabbit *between* my feet!"


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

Date: Fri, 18 Apr 1997 00:45:18 GMT
From: frank@primemail.com (Frank Fisher)
Subject: Sorting On Columns of an Array of Data Question
Message-Id: <3356c37e.1214835@nntp.a001.sprintmail.com>

I have a customer array with the following type of data:

john smith 1234 main st CA 90245 310-456-9876

How can I sort this data for different reports on certain colums?

For example, how would I sort on the 2nd field the lastname field? or
sort on the State field?  I read the sort() function my perl book but
it does not cover sort on columns.

Thanks...

--frank



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

Date: Fri, 18 Apr 1997 02:13:21 +0200
From: Magnus Holmberg <pucko@lysator.liu.se>
Subject: strange characters
Message-Id: <3356BCA1.3A28@lysator.liu.se>

Hello!

I have a script whichs sends a form as a mail. The problem is that our
swedish characters seems to look like somting very strange depending of
which mailprogram I use to read the mail. How can i do to replace those
with something else?

I tried this but it does not work:

$value =~ s/e/a/g; (e is an a whith a ring over it, if its look strange
hear too.)

/Magnus - Pucko - The Water Of Life!


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

Date: Thu, 17 Apr 1997 14:26:26 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Transliterate from a pattern?
Message-Id: <2ht5j5.hn1.ln@localhost>

ALASTAIR AITKEN CLMS (zpalastair@unl.ac.uk) wrote:
: In article <5j2vs1$af8@news-central.tiac.net>, mike@stok.co.uk (Mike Stok) writes:
: >In article <5j2st1$fga@epsilon.qmw.ac.uk>,
: >ALASTAIR AITKEN CLMS <zpalastair@unl.ac.uk> wrote:
: >>In article <570ni5.gug.ln@localhost>, tadmc@flash.net (Tad McClellan) writes:
: >
: >>>$value  =~ /^\s+//; # delete leading spaces
: >>>$value  =~ /\s+$//; # delete trailing spaces
: >>>
: >>
: >>in one pattern:
: >>
: >>$var =~ s/^\s+|\s+$//;
: >
: >The single pattern needs a g modifier to work:


: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca> wrote @ Wed, 16 Apr 1997 13:14:40

: actually you'd need to put the g modifier on if you wanted
: it to strip both leading and trailing spaces from a given
: string:
: $var =~ s/^\s+|\s+$//g;

: And: eli@NetUSA.Net (Eli The Bearded) wrote @ Wed, 16 Apr 1997 14:10 -0400 (EDT)

: > >$var =~ s/^\s+|\s+$//;

: > Shouldn't that have a /g on it?

: No it shouldn't.  
  ^^^^^^^^^^^^^^^

Eh?


: There can only be one beginning and one end to a string.  
: Global substitution is only ever necessary where a pattern might match two or
: more times within a string and you want both occurences to be substituted.

: I have tried this and it works without the g modifier.  I think for the above
  ^^^^^^^^^^^^^^^^^

Cool. Please post that code (because I'm having a hard time believing you ;-)


: reason.


------------------
#! /usr/bin/perl -w

$_ = '   foo   ';

s/^\s+|\s+$//;

print "'$_'\n";
------------------


trailing spaces remain...


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 17 Apr 1997 17:06:55 -0700
From: brannon@bufo.usc.edu (Terrence M. Brannon)
Subject: Re: unreading a line of input
Message-Id: <ysizwwq1ry7a.fsf@bufo.usc.edu>


> Is there a module that does this kind of stuff?  

There is something that does one-line lookahead documented under the
SUB function in Camel 2.

-- 
o============o  Sending  unsolicited commercial e-mail (UCE) to this address
 Legal Notice   is indication of your consent to pay me $120/hour for 1 hour
o============o  minimum for professional proofreading & technical assessment.
terrence brannon * brannon@kappa.usc.edu * http://rana.usc.edu:8376/~brannon


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

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

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