[7541] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1168 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 13 11:17:10 1997

Date: Mon, 13 Oct 97 08:00:24 -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           Mon, 13 Oct 1997     Volume: 8 Number: 1168

Today's topics:
     Re: 5.004_03 test failure on IRIX 5.3 <hietanie@koah.research.nokia.com>
     Re: ?Help making MakeMaker/NT (Jeremy D. Zawodny)
     Re: ?Help making MakeMaker/NT (Ken Gaugler)
     Re: Are there problems using back quotes on Win95? (Jeremy D. Zawodny)
     Re: Can someone look at this and tell me why it doesn't (Tad McClellan)
     Re: Can someone look at this and tell me why it doesn't (Toutatis)
     Re: Can someone look at this and tell me why it doesn't (Tad McClellan)
     Checking for a file <jgrimm@wireedm.com>
     Re: Checking for a file <eike.grote@theo.phy.uni-bayreuth.de>
     Re: chmod problem (Jeremy D. Zawodny)
     Re: click on cgi script to download file (Jeremy D. Zawodny)
     E-mail header and REGEXP (Adm)
     Re: E-mail header and REGEXP (Casper K. Clausen)
     Re: help building libraries (Jeremy D. Zawodny)
     Help embedding html tag in output <cwelch@cais.com>
     How can I "use vars" with Perl 5.001? (Dan Sumption)
     Re: How to do hashes in CGI.pm - help needed please! (I R A Aggie)
     Re: Multidimensional Arrays (Jeremy D. Zawodny)
     perl -e -i ... <Berne@worldnet.att.net>
     Recursive pattern replacement - help (Donna Smith CT90)
     s/ / /g or tr/ / /   what is the difference? <bwilcox@shianet.org>
     Re: s/ / /g or tr/ / /   what is the difference? (Toutatis)
     Re: Server-Push and MS IE (Jeremy D. Zawodny)
     Re: telnet (Net::Telnet module) <twarneke@cisco.com>
     Re: telnet (Net::Telnet module) (I R A Aggie)
     Testing for file <jgrimm@wireedm.com>
     Re: the oddest syntax error (Fritz Knack)
     Re: umask and mkdir.. (robert)
     Re: Wanted: Wall/Schwartz book (1st ed) (Sitaram Chamarty)
     Warnings when testing undefined variables with perl -w (Dan Sumption)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 13 Oct 1997 15:43:29 +0300
From: Jarkko Hietaniemi <hietanie@koah.research.nokia.com>
Subject: Re: 5.004_03 test failure on IRIX 5.3
Message-Id: <dpk9fhal5a.fsf@koah.research.nokia.com>


 ..and the RSN 5.004_04 will have even more bug fixes and speed
enhancements for Math::Complex.

-- 
Jarkko Hietaniemi


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

Date: Mon, 13 Oct 1997 12:36:31 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: ?Help making MakeMaker/NT
Message-Id: <344b14b5.406846063@igate.hst.moc.com>

[cc'd automagically to original author]

On 12 Oct 1997 12:12:35 GMT, keng@removethis.wco.com wrote:

>Isn't MakeMaker and/or extutils supposed to be part of the perl5 
>distribution? Did I forget something? I installed Pw32i310, plsei310,
>and Piis310. Can someone help me sort this out?

MakeMaker support doesn't yet exist in the ActiveState Perl. You may
want to try Gurusamy Sarathy's port of Perl5.004 for Win32. It's on
CPAN, of course.

Jeremy
-- 
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio

http://www.marathon.com/

Unless explicitly stated, these are my opinions only--not those of my employer.


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

Date: Mon, 13 Oct 1997 14:06:03 GMT
From: keng@nospam.hybrid.com (Ken Gaugler)
Subject: Re: ?Help making MakeMaker/NT
Message-Id: <34422aa9.239954154@dracula.hybrid.com>

On Mon, 13 Oct 1997 12:36:31 GMT, zawodny@hou.moc.com (Jeremy D.
Zawodny) wrote:

>[cc'd automagically to original author]
>
>On 12 Oct 1997 12:12:35 GMT, keng@removethis.wco.com wrote:
>
>>Isn't MakeMaker and/or extutils supposed to be part of the perl5 
>>distribution? Did I forget something? I installed Pw32i310, plsei310,
>>and Piis310. Can someone help me sort this out?
>
>MakeMaker support doesn't yet exist in the ActiveState Perl. You may
>want to try Gurusamy Sarathy's port of Perl5.004 for Win32. It's on
>CPAN, of course.
>
>Jeremy

Got it. I highly recommend this port. Installation was a breeze!


---
To reply to this post, remove the 'nospam.' from my address.
Ken Gaugler  N6OSK  Systems Engineer, Hybrid Networks, Inc.
(personal: keng @wco.com  URL: http://www.wco.com/~keng)


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

Date: Mon, 13 Oct 1997 12:25:24 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Are there problems using back quotes on Win95?
Message-Id: <344812ef.406392321@igate.hst.moc.com>

[cc'd automagically to original author]

On 11 Oct 1997 01:03:15 GMT, "David Ransier"
<david_ransier@intercept.com> wrote:


>Are there problems using back quotes on Win95?

Yes.

>I seem to be having a problem on Win95 with statements like:
>
>   $var = `command shell command goes here`;
>
>$var does not get any return values.

What is the command you're running? Do the results vary wit command,
or do *all* commands produce the same results?

Jeremy
-- 
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio

http://www.marathon.com/

Unless explicitly stated, these are my opinions only--not those of my employer.


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

Date: Mon, 13 Oct 1997 06:33:43 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Can someone look at this and tell me why it doesn't work!!
Message-Id: <nu0t16.4j.ln@localhost>

Jeff Gostin (jgostin@shell2.ba.best.com) wrote:
: Tad McClellan <tadmc@flash.net> wrote:
: : That should work fine if $PassFileName, $LogValue, $PassFile, and
: : $PassValue are all numbers instead of strings.

: If this is an RTFM, point me at the FM, and I'll happily read away. I don't
: suspect it is, and I suspect that the answer is 'no' because of PERL's lack
: of specific data types, but here's the question:


Uh. I did point to the FM. In the same post that you quoted above, I 
wrote:

   One of the headings in the perlop man page is "Equality Operators".

   There it says:

   "Binary "==" returns true if the left argument is numerically equal to
   the right argument.

    ...

   Binary "eq" returns true if the left argument is stringwise equal to
  the right argument."


>From which you might conclude that the perlop man page is the 
applicable FM  ;-)


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: 13 Oct 1997 11:42:12 GMT
From: toutatis@_SPAMTRAP_toutatis.net (Toutatis)
Subject: Re: Can someone look at this and tell me why it doesn't work!!
Message-Id: <toutatis-ya023180001310971342150001@news.euro.net>

In article <61skia$3h6$2@nntp1.ba.best.com>, Jeff Gostin
<jgostin@shell2.ba.best.com> wrote:

> Casper K. Clausen <ckc@dmi.min.dk> wrote:
> : if ($variable =~ /[\d\.]+/) {
> :       print "It's a number!";
> : } else {
> :       print "It's a string!";
> : };
> : Or is this too easy?
> 
> I appreciate the snippet, and tried it out to see how it'd work. Given the
> following:
> 
>         #!/usr/local/bin/perl5 -w
>         $variable = "123abc123";
>         # Casper's code below
>         if ($variable =~ /[\d\.]+/) {
>                 print "It's a number!";
>         } else {
>                 print "It's a string!";
>         };
> 
> ... the code prints "It's a number" when, in fact, $variable is _not_
> numeric. However, I thought through what you were doing with the regexp, and
> made a slight change:
> 
>         #!/usr/local/bin/perl5 -w
>         $variable = "abc123123";
>         # Jeff's mod of Casper's code -- note the changed regexp.
>         if ($variable =~ /^\w\d+$/) {
>                 print "It's a number!\n";
>         } else {
>                 print "It's a string!\n";
>         };
> 
> This does appear to work correctly, tested for "abc123123", "123abc123", and
> "123"... and my question is answered.

Nice to be easily pleased, but your code is wrong as well.
/^\w\d+$/ means: starting whith *one* alfanumeric (A..Za..z0..9_), followed
by one ore more digits. So your code thinks "A67" is a number.

A simple, but for most purposes sufficient regex: /^[+-]?(\d*\.)?\d+$/

-- 
Toutatis


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

Date: Mon, 13 Oct 1997 06:44:00 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Can someone look at this and tell me why it doesn't work!!
Message-Id: <0i1t16.jl.ln@localhost>

Tad McClellan (tadmc@flash.net) wrote:
: Jeff Gostin (jgostin@shell2.ba.best.com) wrote:
: : Tad McClellan <tadmc@flash.net> wrote:
: : : That should work fine if $PassFileName, $LogValue, $PassFile, and
: : : $PassValue are all numbers instead of strings.

: : If this is an RTFM, point me at the FM, and I'll happily read away. I don't
: : suspect it is, and I suspect that the answer is 'no' because of PERL's lack
: : of specific data types, but here's the question:


: Uh. I did point to the FM. In the same post that you quoted above, I 
: wrote:


Uh, Uh. I think you must have meant "If that is an RTFM" (the Q below)
rather than "this" (what you quoted above)  ;-)

In that case, the applicable FM is the Perl FAQ, part 4:

   "How do I determine whether a scalar is a number/whole/integer/float?"


:    One of the headings in the perlop man page is "Equality Operators".

:    There it says:

:    "Binary "==" returns true if the left argument is numerically equal to
:    the right argument.

:     ...

:    Binary "eq" returns true if the left argument is stringwise equal to
:   the right argument."


: From which you might conclude that the perlop man page is the 
: applicable FM  ;-)


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: Mon, 13 Oct 1997 06:56:28 -0700
From: John Grimm <jgrimm@wireedm.com>
Subject: Checking for a file
Message-Id: <3442288C.4599@wireedm.com>

How can I check to see if a file is there or not?

nick@wireedm.com


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

Date: Mon, 13 Oct 1997 16:10:02 +0200
From: Eike Grote <eike.grote@theo.phy.uni-bayreuth.de>
Subject: Re: Checking for a file
Message-Id: <34422BBA.794B@theo.phy.uni-bayreuth.de>

Hi,

John Grimm wrote:
> 
> How can I check to see if a file is there or not?

Take a look at the 'perlfunc' manual page - it shows (near the
beginning) several operators to test files (existence, ownership,
age,...).


Bye, Eike
-- 
=======================================================================
>>--->>    Eike Grote  <eike.grote@theo.phy.uni-bayreuth.de>    <<---<<
-----------------------------------------------------------------------
 Home Page, Address, PGP,...:  http://www.phy.uni-bayreuth.de/~btpa25/
-----------------------------------------------------------------------
 PGP fingerprint:      1F F4 AB CF 1B 5F 4B 1D 75 A1 F9 C5 7B 3F 37 06
=======================================================================


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

Date: Mon, 13 Oct 1997 12:20:32 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: chmod problem
Message-Id: <344611f7.406143773@igate.hst.moc.com>

[cc'd automagically to original author]

On 10 Oct 1997 22:43:29 GMT, "Justin White" <whitek@thegrid.net>
wrote:

>  Permission denied at /var/www/cgi-bin/domain.cgi line 13.
>  [Fri Oct 10 14:40:57 1997] access to /var/www/cgi-bin/domain.cgi failed
>for 209.
>  60.101.33, reason: Premature end of script headers
>
>I changed the mode as follows:
>
>  chmod 755 VirtualData - and - chmod =r+w VirtualData - and - chmod r+w,+X
>VirtualData
>
>and still get the permission denied error.

Who owns the file?

Jeremy
-- 
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio

http://www.marathon.com/

Unless explicitly stated, these are my opinions only--not those of my employer.


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

Date: Mon, 13 Oct 1997 12:29:51 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: click on cgi script to download file
Message-Id: <344913c8.406608822@igate.hst.moc.com>

[cc'd automagically to original author]

On Sat, 11 Oct 1997 19:27:52 GMT, dwaters@delphi.co.uk (David Waters)
wrote:

>I've seen on some web pages, where you click a script
>and it downloads an appropriate file.

Really? I've never seen such a thing. Are you sure they don't click on
a button or maybe a graphic?

>How is this done within the script to tell the browser
>to download a file.

The browser downloads every file--graphic, web page, and so on. The
MIME type of the downloaded file is what the browser uses to determine
how best to present the file.

>Preferably in perl please

I don't see how what you've asked is a Perl question. It sounds more
like you're not understanding how the technology works.

Jeremy
-- 
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio

http://www.marathon.com/

Unless explicitly stated, these are my opinions only--not those of my employer.


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

Date: Sun, 12 Oct 1997 16:21:13 GMT
From: hoo@wms.it (Adm)
Subject: E-mail header and REGEXP
Message-Id: <61qted$1dhb4$1@urano.inet.it>
Keywords: REGEXP,mail,header

Hi this is my problem:
I'm trying to write a Web interface for a POP3 server to let users see and 
delete E-mail without have to buy/use/configure a mail program.
Now I'm fighting whith the extreme diversity of  the mail headers.
The 'Date' line seems like:
1)  Date: xxx, dd mmm yyyy ..................
2)  Date: xxx, dd mmm yy .................
3)  Date: dd mmm yyyy ..............
4)  Date: dd mmm yy ................
where:
'xxx' is the day:Mon,Tue..
'mmm' is the month:Oct,Dec....
'dd' is the day:1,2,3...
'yy' or 'yyyy' is the year:97 or 1997

I'm not a REGEXP's guru , so can someone help me to write a function to 
extract the Day/Month/Year alwais in the same form (dd mmm yyyy) ?

Even a simple link is well accepted.

P.S. CC directly to me because my news-server delete old message very quickly 
(>3 day).

My address is: hoo@wms.it

Tanks in advance!



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

Date: 13 Oct 1997 13:54:47 +0200
From: ckc@dmi.min.dk (Casper K. Clausen)
Subject: Re: E-mail header and REGEXP
Message-Id: <wvp201p3mk8.fsf@hobbes.dmi.min.dk>

>>>>> " " == Adm  <hoo@wms.it> writes:


 > Hi this is my problem: I'm trying to write a Web interface for a
 > POP3 server to let users see and delete E-mail without have to
 > buy/use/configure a mail program.  Now I'm fighting whith the
 > extreme diversity of the mail headers.  The 'Date' line seems like:
 > 1) Date: xxx, dd mmm yyyy .................. 
 > 2) Date: xxx, dd mmm yy ................. 
 > 3) Date: dd mmm yyyy .............. 
 > 4) Date: dd mmm yy ................

Well, since it appears that the first digits on the line are always
the date, I'd try something like the following. This is not tested,
but pretty straightforward. Also not that this is very unlikely to be
the most efficient solution; it's just the first one I thought
of. Here goes:

# Assuming the line with the date field is on $_

/^Date:\D+?(\d{2}) (\d{3}) (\d+) .*/;
$date = $1;$month = $2;$year = $3;
$year = "19" . $year if $year < 100;
$datestring = $date . " " . $month . " " . $year;

Kvan.
-- 
-------Casper Kvan Clausen------ | 'Ah, Warmark, everything that passes
----------<ckc@dmi.dk>---------- |  unattempted is impossible.'
           Lokal  544            |   
I do not speak for DMI, just me. |        - Lord Mhoram, Son of Variol.      


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

Date: Mon, 13 Oct 1997 12:38:26 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: help building libraries
Message-Id: <344c161b.407203808@igate.hst.moc.com>

[cc'd automagically to original author]

On 12 Oct 1997 15:30:14 GMT, keng@removethis.wco.com wrote:

>Trying to install libnet-1.0505 (and others) I get the message:
>"Checking to see if your kit is complete....
>Can't locate ExtUtils/Manifest.pm in @INC at (eval 1) line 374.
>
>There is indeed no "manifest.pm" in the extutils directory. Was that
>supposed to have been generated when I installed the Perl/Win32 source?

Get Gurusamy Sarathy's Perl5.004 for Win32 port, and I think you'll
have better luck. You're using AvtiveState's, right?

Jeremy
-- 
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio

http://www.marathon.com/

Unless explicitly stated, these are my opinions only--not those of my employer.


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

Date: Mon, 13 Oct 1997 08:49:26 -0400
From: Chris Welch <cwelch@cais.com>
Subject: Help embedding html tag in output
Message-Id: <344218D6.7F77@cais.com>

I'm parsing a string for a users's request. They enter a state via a
pulldown and it matches this in the "states_served" field. When I output
this I'd like to make the state they selected bold.

In other words make "VA-MD-WV" appear as "<b>VA</b>-MD-WV" when it's
displayed. 

I've looked high and low but don't have a clue as to what I'm doing
wrong. I'm learning Perl on my own and don't know anybody at work using
it...

Am I even on the right track ? I've tried the following:   
     $tserved =~ tr'$fstate'<b>$fstate</b>';

Regards,
CW (cwelch@cais.com)
http://www.cais.com/cwelch/gsrc/


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

Date: Mon, 13 Oct 1997 13:10:28 GMT
From: dan@gulch.demon.co.uk (Dan Sumption)
Subject: How can I "use vars" with Perl 5.001?
Message-Id: <34431497.2467888@news.demon.co.uk>

I am in the middle of developing a set of packages, which I have been
testing on my machine running Activeware's Perl for Windows NT 5.00307
- and everything is running fine.

However, I just uploaded them to my ISP, who runs a UNIX version of
Perl 5.001, and I am not getting very far.

First of all, I got the message:
Can't locate vars.pm in @INC at RealityCell.pm line 3.

I have spoken to my ISP, and they tell me that the vars module is only
standard from 5.002 - and they have no plans to upgrade at present.

I have tried uploading my copy of vars.pm into the application's
working directory, but as I expected, this doesn't help much; it just
gives me error messages like:
Global symbol "ISA" requires explicit package name at RealityParser.pm
line 34

Does anyone know of a good workaround which doesn't require removing
every  'use strict' in the program?

Dan Sumption
http://www.hardnet.co.uk/dan/


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

Date: Mon, 13 Oct 1997 10:23:14 -0400
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: How to do hashes in CGI.pm - help needed please!
Message-Id: <-1310971023150001@aggie.coaps.fsu.edu>

In article <VwI14PAl8TQ0EwZS@dozyrosy.demon.co.uk>,
Postmaster@dozyrosy.demon.co.uk wrote:

[reply-to a postmaster? ok]

+ CGI.pm documentation gives examples of how to get the names of all the
+ parameters:
+     @names = $query->param
+ 
+ or how to get the value(s) of a SINGLE named parameter:
+     @values = $query->param('foo')
+     $value  = $query->param('foo')
+ 
+ But how do I get names and values into a hash where both are unknown
+ quantities???

No, they aren't. You just told us how to get them! Ok, here's one
approach:

@keys = $query->param;
foreach $key (@keys) {
   $myarray{$key}=$query->param($key};
}

James

-- 
Consulting Minister for Consultants, DNRC
Support the anti-Spam amendment <url:http://www.cauce.org/>
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>


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

Date: Mon, 13 Oct 1997 12:31:36 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Multidimensional Arrays
Message-Id: <344a1492.406810712@igate.hst.moc.com>

[cc'd automagically to original author]

On Sun, 12 Oct 1997 04:25:41 -0700, ryanr <ryanr@poolpros.com> wrote:

>the table looks like this:
>
>             Widths 10 20 30 40 50 60 70
>
>Lengths   10      12 13 14 15 16 17 18
>               20      19 20 21 22 23 24 25
>               30      26 27 28 29 30 31 32
>               40      33 34 35 36 37 38 39
>               50      40 41 42 43 44 45 46
>               60      47 48 49 50 51 52 53
>               70      54 55 56 57 58 59 60
>
>I'm not really sure how I should go about storing this table.  I would
>like to just put it in a standard multidimensional array, but I'm not
>sure I fully understand how to do it in perl.

The FAQ has some answers for you.

Jeremy
-- 
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio

http://www.marathon.com/

Unless explicitly stated, these are my opinions only--not those of my employer.


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

Date: 13 Oct 1997 12:22:58 GMT
From: "Berne Woolley" <Berne@worldnet.att.net>
Subject: perl -e -i ...
Message-Id: <61t3r2$2fg@bgtnsc02.worldnet.att.net>

I have a file that contains the string "unikixvsamHP" once and the string
"$(COBOL) $(COBFLAGS)" on many lines. I want to insert a string between the
2 words of the COBOL string. 
$(BINDIR)/unikixvsamHP:         $(VSAMOBJECTS) makefile
        rm -f $@
        $(COBOL) $(COBFLAGS) -x $(LDFLAGS) -o $@ \

So, what have I wrong with this perl 5.003 command? I simply end up with
identical copies of makefile & makefile.orig. I've tried it with and
without the s modifier (i.e., s/.../.../s).
perl -e 's/.*(unikixvsamHP.+?\$\(COBOL\))\s+?(\$\(COBFLAGS\))/$1 Syncsort
String $2/' -wp -i.orig ./makefile



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

Date: 13 Oct 1997 13:53:48 GMT
From: d1smith@gmr.com (Donna Smith CT90)
Subject: Recursive pattern replacement - help
Message-Id: <61t95c$2lv@rcsuna.gmr.com>

I'm trying to search for and replace a pattern in a
directory tree that is over 3GB (an entire web site).
The pattern is in html and is very long but is the same in
all of the files it appears in.

<center><a href="/htbin/imagemap/toolbar... yada yada yada
I'm trying a quick and dirty way, escaping all the appropriate characters with:

perl -pi.bak -e 's/\<center\>\<a href\=\"\/htbin.../new string' `cat filelist`

where filelist is a file containing a list of all the html
files in this directory tree.  This works fine on a short list but the system can't handle an input list of files this big and I get: 

Argument list too long

Can someone please help me?
d1smith@gmr.com



---
Donna M. Smith
d1smith@rcsuna.gmr.com



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

Date: Mon, 13 Oct 1997 08:35:50 -0400
From: Bob Wilcox <bwilcox@shianet.org>
Subject: s/ / /g or tr/ / /   what is the difference?
Message-Id: <344215A6.3805@shianet.org>

Could someone explain the difference between s/// and tr/// and when you
use one or the other?


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

Date: 13 Oct 1997 14:07:16 GMT
From: toutatis@_SPAMTRAP_toutatis.net (Toutatis)
Subject: Re: s/ / /g or tr/ / /   what is the difference?
Message-Id: <toutatis-ya023180001310971607170001@news.euro.net>

In article <344215A6.3805@shianet.org>, bwilcox@shianet.org wrote:

> Could someone explain the difference between s/// and tr/// and when you
> use one or the other?

The return value:
tr/// counts the substituted characters, s/// returns boolean (1 or 0).

print "xxxxxx" =~ s/x/ /g;  #prints '1'
print "xxxxxx" =~ tr/x/ /;  #prints '6'

-- 
Toutatis


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

Date: Mon, 13 Oct 1997 12:22:59 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Server-Push and MS IE
Message-Id: <34471254.406237308@igate.hst.moc.com>

[cc'd automagically to original author]

On 10 Oct 1997 23:14:43 GMT, "Matthias Hellmund"
<matthias.hellmund@nienburg-weser.de> wrote:

>I'd like to have some chat-lines as a datastream via Server-Push. I know,
>that there is no new-page-clear with MS IE, but why are lines not printed
>out line by line with pauses like with Netscape?!?

Netscape is a company, Navigator is their flagship product. You
wouldn't say "Microsoft" when you meant "Excel", would you?

Sounds like a browser "problem", not a Perl problem. As the browser
people.

>URL: http://195.4.19.9/~hellmund/cgi-bin/nph-out2.pl
>
>Chat-Test: http://195.4.19.9/~hellmund/ghetto-chat.html
>
>Why is everything printed out at the end with MS IE instead as a stream?
>I hope anybody out there can help me... (please also via eMail!!!)

Had you thought that MSIE may buffer the data and Navigator does not?

Jeremy
-- 
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio

http://www.marathon.com/

Unless explicitly stated, these are my opinions only--not those of my employer.


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

Date: Mon, 13 Oct 1997 08:59:03 -0400
From: Tom Warneke <twarneke@cisco.com>
Subject: Re: telnet (Net::Telnet module)
Message-Id: <34421B17.A1AEE2FA@cisco.com>

Hi, 

I have a need to use something like the Net::telnet module.

How can I access the CPAN site you referenced?

thank you,

-- 
Tom Warneke
email: twarneke@cisco.com


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

Date: Mon, 13 Oct 1997 10:27:23 -0400
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: telnet (Net::Telnet module)
Message-Id: <-1310971027230001@aggie.coaps.fsu.edu>

In article <34421B17.A1AEE2FA@cisco.com>, Tom Warneke <twarneke@cisco.com>
wrote:

+ I have a need to use something like the Net::telnet module. 
+ How can I access the CPAN site you referenced?

<url:http://www.perl.com/CPAN>

James

-- 
Consulting Minister for Consultants, DNRC
Support the anti-Spam amendment <url:http://www.cauce.org/>
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>


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

Date: Mon, 13 Oct 1997 06:59:12 -0700
From: John Grimm <jgrimm@wireedm.com>
Subject: Testing for file
Message-Id: <34422930.1615@wireedm.com>

How can I test to see if a file is there?

nick@wireedm.com


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

Date: Mon, 13 Oct 1997 13:37:01 GMT
From: fritz.knack@nospam.POPULUS.net (Fritz Knack)
Subject: Re: the oddest syntax error
Message-Id: <3442232a.5731712@snews.zippo.com>

On Sun, 12 Oct 1997 18:01:17 -0400, Kenneth Taborek
<oberon@nospam.erols.com> wrote:

<snip>
>syntax error at ./thingy.pl line 12, near "if"
>Execution of ./thingy.pl aborted due to compilation errors.
>
>Here is my script:
>
>
>#! /usr/bin/perl
>
>$i = 0;
>%rot13 = {};
>
>@alpha = (a..z);
>@temp1 = (n..z);
>@temp2 = (a..n);
>
>for ($i = 0; $i < 26; $i++)  {
>
>    if ($i < 13)  {
>
>        $rot13{$alpha[$i]} = $alpha[($i + 13)];
>    }
>    else  {
>        $rot13{@alpha[$i]} = $alpha[($i - 13)];
>    }
>}
>
<snip>

This may be unrelated to your original problem, but shouldn't your
else statement use $alpha[$i] rather than @alpha[$i]? (I'm a newbie on
this stuff, so I probably wouldn't have spotted it except that my
newsreader thought it was a mailing address.)

Fritz


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

Date: 13 Oct 1997 12:58:21 +0200
From: robert@il.fontys.nl (robert)
Subject: Re: umask and mkdir..
Message-Id: <61susd$ua@bsd1.hqehv-internal.ilse.net>

alex@gossamer-threads.com (Alex Krohn):
 >I'm having a real problem with mkdir. What I want to do is create a
 >directory (from the web) and create a file inside the directory (again
 >from the web). I need to create the directory with permissions 777 (as
 >the web server runs as other) so that I can create the file inside of
 >it.

Are you sure you have permission to create that directory in the first
place? It's parent directory should be writeable for other.

                                                                robert


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

Date: 13 Oct 1997 13:53:06 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: Wanted: Wall/Schwartz book (1st ed)
Message-Id: <slrn63qgo3.1sv.sitaram@ltusitaram.diac.com>

On 09 Oct 1997 19:54:02 +0200, Oliver Flimm <flimm@ph-cip.uni-koeln.de> wrote:
>I got my panther book here in germany on 16.9. - and I like it a lot ;-) 

Err, umm, what is the panther book?  Am I behind in my purchase of Perl books
(from ORA only, I may add)? :-)


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

Date: Mon, 13 Oct 1997 14:51:18 GMT
From: dan@gulch.demon.co.uk (Dan Sumption)
Subject: Warnings when testing undefined variables with perl -w
Message-Id: <3444303d.9545515@news.demon.co.uk>

I am writing a script which, when run using perl -w, generates a
number of warnings.

All of the lines generating warning are ones where I am testing to see
if a variable has a defined value, e.g.
    my $parent = undef;
    if ($parent = $self->{ALLITEMS}[$#{$self->{ALLITEMS}}]) {
	.... code here....
    }

This generates the warning "Use of uninitialized value at....."

Is there a standard workaround for this, or am I stuck with a screen
full of warnings (or am I doing it all wrong?)

Thanks.

Dan Sumption
http://www.hardnet.co.uk/dan/


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

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

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