[19862] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2057 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Nov 3 00:06:05 2001

Date: Fri, 2 Nov 2001 21:05:06 -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: <1004763906-v10-i2057@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 2 Nov 2001     Volume: 10 Number: 2057

Today's topics:
    Re: '#!/usr/local/bin/perl -s' problem <mgjv@tradingpost.com.au>
    Re: [OT] help with simple script (Tad McClellan)
    Re: [OT] help with simple script <mgjv@tradingpost.com.au>
        beginner perlist (flanney)
        Bold text in UNIX and Windows <usyk@home.com>
    Re: CGI.pm and File Upload Problem (Ralph Snart)
        Compile problems 5.6.1 <trljc@altern.org>
    Re: Contents of a hash blank in only *part* of a module <mgjv@tradingpost.com.au>
        Direct iteration over aoh <hbhb@gmx.de>
    Re: Direct iteration over aoh (John J. Trammell)
        Drill questions and answers. <seedkum-aladeem@home.com>
        fwdport from Perl Cookbook recipe 17.18 - hangs on read (stephen peterson)
    Re: Help modifying a sort routine <mgjv@tradingpost.com.au>
    Re: Help modifying a sort routine <tsee@gmx.net>
    Re: Is it possible to convert a UNIX shell command into <Dan.Nguyen@lsil.com>
    Re: One liners vs. verbose code <ellem@webcombo.net>
    Re: One liners vs. verbose code (Tad McClellan)
    Re: One liners vs. verbose code (Lou Moran)
    Re: Perl on Windows2000 <me@home.com>
    Re: reading flat-file db and replacing a word <bootsy52@gmx.net>
    Re: Regexp for email address <iltzu@sci.invalid>
    Re: Serving HTML images <stuart@otenet.gr>
    Re: Unsigned 8 bit math (addition and subtraction) <nospam-abuse@ilyaz.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 3 Nov 2001 11:03:45 +1100
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: '#!/usr/local/bin/perl -s' problem
Message-Id: <slrn9u6d31.1rg.mgjv@martien.heliotrope.home>

On Fri, 02 Nov 2001 16:17:21 +0000,
	scott douglass <sdouglass@_%junk%_.arm.com> wrote:
> I'm having trouble with a script like this (adapted very slightly from the
> perlrun man page):
> 
> --- foo ---
> #!/usr/local/bin/perl -s
> if ($xyz) { print "$xyz\n" }
> -----------

-s is slightly buggy. I've never used it myself, or attempted to use it,
but I do recall other posts in this nesgroup discussing broken things
involving -s. I think it's because no one uses it anymore. 

> 
> If I invoke this as
>     ./foo -xyz=abc
> it prints
>     abc
> as expected.
> 
> But if I invoke this as
>     /usr/local/bin/perl ./foo -xyz=abc
> it prints nothing because the '-s' switch on the '#!' line is being ignored.

It is possible that -s is one of those switches (like -T, see perldiag
"Too late for") that cannot be called this way, but maybe it's just not
considered an error. What happens if you do:

/usr/local/bin/perl -s ./foo -xyz=abc

That should make it work again.

> I do not expect the '-s' switch on the '#!' line to be ignored.  man perlrun
> says:
>> [...] The #! line is always examined for switches as the line is being parsed. [...]

And this is of course true, but not all switches are treated entirely
equal. it looks like -s needs to be present on first invocation of the
interpreter, but for some reason it isn't an error or even worth a
warning if it appears too late. This may very well be a bug (I'd
certainly call it one), and maybe you could consider reporting it.

If I were you, I'd give up on -s, and I'd use Getopt::Std or
Getopt::Long. Both are standard modules (part of the Perl distribution)
At least you can use those without using global variables.

Martien
-- 
                                | 
Martien Verbruggen              | That's not a lie, it's a
                                | terminological inexactitude.
                                | 


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

Date: Fri, 02 Nov 2001 23:51:44 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: [OT] help with simple script
Message-Id: <slrn9u69lg.ejn.tadmc@tadmc26.august.net>

John J. Trammell <trammell@haqq.hypersloth.invalid> wrote:
>On 2 Nov 2001 20:27:26 GMT, Jason Kohles <usenet@jasonkohles.com> wrote:
>> On Fri, 2 Nov 2001 14:08:25 -0600, John J. Trammell wrote:
>> >On Fri, 02 Nov 2001 14:39:49 -0500, Terry <tdupuis@omafra.gov.on.ca> wrote:
>> >> X-No-Archive: Yes
>> >
>> >You realize that this is not in your message's header, and
>> >needs to be, right?
>> >
>> Most of the big archiving sites will honor it as the first line of the message,
>> in case your newsreader doesn't let you modify the headers.
>> 
>Damned if I don't learn something new every day.  :-)


Sheesh! Now I gotta go figure out how to score based on
body content, I've been doing fine just looking at headers,
until learning about the above.


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


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

Date: Sat, 3 Nov 2001 11:31:54 +1100
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: [OT] help with simple script
Message-Id: <slrn9u6enq.1rg.mgjv@martien.heliotrope.home>

On Fri, 02 Nov 2001 23:51:44 GMT,
	Tad McClellan <tadmc@augustmail.com> wrote:
> John J. Trammell <trammell@haqq.hypersloth.invalid> wrote:
>>On 2 Nov 2001 20:27:26 GMT, Jason Kohles <usenet@jasonkohles.com> wrote:
>>> On Fri, 2 Nov 2001 14:08:25 -0600, John J. Trammell wrote:
>>> >On Fri, 02 Nov 2001 14:39:49 -0500, Terry <tdupuis@omafra.gov.on.ca> wrote:
>>> >> X-No-Archive: Yes
>>> >
>>> >You realize that this is not in your message's header, and
>>> >needs to be, right?
>>> >
>>> Most of the big archiving sites will honor it as the first line of the message,
>>> in case your newsreader doesn't let you modify the headers.
>>> 
>>Damned if I don't learn something new every day.  :-)
> 
> Sheesh! Now I gotta go figure out how to score based on
> body content, I've been doing fine just looking at headers,
> until learning about the above.

\begin{Offtopic}

Scoring on body content, in most news readers, isn't possible. It would
require you to pull down evry single body, instead of just all the
headers.

However, with things like leafnode and nntpcache, one could do things at
the 'server' end.

\end{offtopic}

Martien
-- 
                                | 
Martien Verbruggen              | For heaven's sake, don't TRY to be
                                | cynical. It's perfectly easy to be
                                | cynical.


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

Date: 2 Nov 2001 18:46:00 -0800
From: weinisfrog@aol.com (flanney)
Subject: beginner perlist
Message-Id: <d5be1a52.0111021845.5ebd1586@posting.google.com>

i just started perl and i was wondering do i have to compile my code
to a cgi file or do i just name a file with cgi extension that has my
code in clear text
thanks


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

Date: Sat, 03 Nov 2001 03:19:56 GMT
From: Walter Usyk <usyk@home.com>
Subject: Bold text in UNIX and Windows
Message-Id: <3BE36277.3040309@home.com>

I was wondering if it is possible to do output the following line of 
text with some bold words inside of the text output. I need to do this 
in UNIX and Windows:

I would like to display the following :

28-Nov.16:04   DBUZULOI    branch type "dbuzuloi_ott.20" (locked)

If anyone is familiar, this is the way ClearCase does it for their 
command output.

I tried using the ANSIColor package but it only works in UNIX and in 
Windows NT I got fuuny looking results like this:

F:\Downloads\Perl>perl color.pl
?[31mDanger, Will Robinson!
?[0mThis is just normal text.
?[1mDo you hurt yet?
?[0m?[31;40mvenom lack
?[31;43mkill that fellow
?[32;46;5mgarish!
?[0m?[31;40mvenom lack
?[0m?[31;43mkill that fellow
?[0m?[32;46;5mgarish!
?[0m?[1;34mThis text is bold blue.
?[0mThis text is normal.
?[33;45mYellow on magenta.
?[0mThis text is normal.
?[33;45mYellow on magenta.
?[0m

Thanks for your help

--
Walter Usyk - Tools Developer
Software Development Environment Tools (1P67)
email: wusyk@nortelnetworks.com
ESN: 398-4603
Tel: (613) 768-4603
 



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

Date: 03 Nov 2001 00:34:18 GMT
From: snart@nospam.com (Ralph Snart)
Subject: Re: CGI.pm and File Upload Problem
Message-Id: <slrn9u6ese.1lmq.snart@cluttered.com>

On Fri, 02 Nov 2001 14:33:02 -0500, Robert Pottschmidt <pottschmidtr@appstate.edu> wrote:
>#!/usr/bin/perl
>use diagnostics;
>use CGI;
>use Mysql;
>my $query = new CGI;
>print $query->header("text/html");
>$test = $query->param("test");
>print $test;
>while(my $bytesread = read($test, my $buffer, 1024)){
>                                print $buffer;
>                        }
>

hmmm, i've never tried that way of doing it.

this is what i do:

print while <$test>

-rs-


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

Date: Fri, 02 Nov 2001 22:13:06 -0500
From: Tony Reed <trljc@altern.org>
Subject: Compile problems 5.6.1
Message-Id: <merde.m3ofmklf7h.infusory@trljc.com>


I configure with all the defaults, and it's happy up to:

       Making B (dynamic)
Writing Makefile for B
make[1]: Entering directory `/usr/src/PERL/perl-5.6.1/ext/B'
make[1]: Leaving directory `/usr/src/PERL/perl-5.6.1/ext/B'
make[1]: Entering directory `/usr/src/PERL/perl-5.6.1/ext/B'
make[1]: *** No rule to make target `B/.pm', needed by `pm_to_blib'.  Stop.
make[1]: Leaving directory `/usr/src/PERL/perl-5.6.1/ext/B'
make: *** [lib/auto/B/B.so] Error 2

and I have no idea.  Can anyone help?

-- 
Tony Reed 
<trljc@altern.org>
"The President was assassinated by a precision guerrilla team of at
least seven men ..." -- Jim Garrison


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

Date: Sat, 3 Nov 2001 10:43:04 +1100
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Contents of a hash blank in only *part* of a module
Message-Id: <slrn9u6bs8.1rg.mgjv@martien.heliotrope.home>

[Please in the future, put your reply _after_ the suitably trimmed text
you reply to. It is the commonly accepted quoting style on this
newsgroup, and Usenet in general] 

On 1 Nov 2001 11:00:43 -0800,
	Nick Temple <nicktemple2000@yahoo.com> wrote:
> Martien Verbruggen <mgjv@tradingpost.com.au> wrote in message news:<slrn9u10b0.ctg.mgjv@verbruggen.comdyn.com.au>...
>> On Wed, 31 Oct 2001 23:33:31 +0100,
>> 	Steffen Müller <tsee@gmx.net> wrote:

[snip]

>> > Anyway, he could at least use 'name='.$user_dat->{'name'}.
>> 
>> I don't see the difference, unless you meant to say: 
>> 
>> He could at least use either 'name='.$user_dat->{'name'} or
>> "name=".$user_dat->{"name"}, to be consistent about the quoting style,
>> or even leave some of the quotes off: "name" . $user_dat->{name}.
>> 
>> If you meant to say that using single quotes is somehow better when
>> the string needs no interpolation, then you have just stumbled upon
>> one of the items that pops up here regularly, and that noone seems to
>> be able to agree on. I don't see the diffeence, some people seem to
>> have problems with double quotes for strings that don't require
>> interpolation. Maybe it depends on what sort of other programming
>> background one has. I tend to use double quotes, unless I want to
>> prevent interpolation, and nowadays I mostly use q// in that case.
>> 
> I think someone has been jacking themselves off too much.

I fail to see why you thought it would be a good idea to tell a
technical newsgroup about what you do in your spare time, especially
sine it seems totally unrelated to the business at hand.

Martien
-- 
                                | 
Martien Verbruggen              | This matter is best disposed of from
                                | a great height, over water.
                                | 


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

Date: Sat, 03 Nov 2001 00:28:55 +0100
From: Holger <hbhb@gmx.de>
Subject: Direct iteration over aoh
Message-Id: <7g46utgmvblffd5ssse0m4ens9caaq29fi@4ax.com>

Hi,

I'd like to output some lines I had in an array like this:

#!/usr/local/bin/perl -w
use strict;
my @array = ('one','two','three');
print join("\n", @array, '');

Now I have changed the array to a hashref because I needed to
store more data than just the text. I do the output this way:

#!/usr/local/bin/perl -w
use strict;
my @array;
$array[0] = {text => 'one'};
$array[1] = {text => 'two'};
$array[2] = {text => 'three'};

foreach my $line (@array)
{
	print "$line->{text}\n";
}

My question is whether it can be done directly or more perlish
like in the first example. I'm a bit disturbed by the explicit
loop.

Best regards,

	Holger


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

Date: Fri, 2 Nov 2001 17:40:10 -0600
From: trammell@haqq.hypersloth.invalid (John J. Trammell)
Subject: Re: Direct iteration over aoh
Message-Id: <slrn9u6bmt.j1g.trammell@haqq.el-swifto.com>

On Sat, 03 Nov 2001 00:28:55 +0100, Holger <hbhb@gmx.de> wrote:
> I'd like to output some lines I had in an array like this:
> 
> #!/usr/local/bin/perl -w
> use strict;
> my @array = ('one','two','three');
> print join("\n", @array, '');
> 
> Now I have changed the array to a hashref because I needed to
> store more data than just the text. I do the output this way:
> 
> #!/usr/local/bin/perl -w
> use strict;
> my @array;
> $array[0] = {text => 'one'};
> $array[1] = {text => 'two'};
> $array[2] = {text => 'three'};
> 
> foreach my $line (@array)
> {
> 	print "$line->{text}\n";
> }
> 
> My question is whether it can be done directly or more perlish
> like in the first example. I'm a bit disturbed by the explicit
> loop.

print join "\n", map $_->{text}, @array;

-- 
[M]en become civilized, not in proportion to their willingness to believe,
but in proportion to their willingness to doubt.            - H.L. Mencken


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

Date: Sat, 03 Nov 2001 00:14:38 GMT
From: Seedkum Aladeem <seedkum-aladeem@home.com>
Subject: Drill questions and answers.
Message-Id: <3BDEEDB6.12910DF1@home.com>

Hi,

I have been searching for a web site with perl drill questions and
answers. Can someone give me a pointer to something like this please?

Thanx,

Seedkum


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

Date: 2 Nov 2001 19:35:52 -0800
From: cspeter8@yahoo.com (stephen peterson)
Subject: fwdport from Perl Cookbook recipe 17.18 - hangs on read from first syn IP packet
Message-Id: <999a2faf.0111021935.105c081a@posting.google.com>

Hi -
I'm trying to get the fwdport program to work, without much luck.  It
seems to me that there is a design error in it, but I'm mystified that
others have not written about it, so maybe I am missing something, or
else I don't know the right places to look?

I'm trying to interpose fwdport in a tcp/ip connection between a
client and a server.  The client opens a port to send and fwdport
accepts the initial packet.  Because it is TCP/IP, it is the first of
3 IP datagrams in a 3-way handshake to establish sequence numbers for
the 2-way session- there is no data for the application layer until
after the connection is established.  So it seems reasonable to me
that when one of the twins tries to read  from this port created as a
result of this first datagram coming in, it finds nothing to read, and
just hangs.

Can someone shed some light on this for me?  I'd like to hear how to
make fwdport work correctly - it seems it needs to use the IP layer
for the first 3 packets, then move up to the TCP layer to begin
ferrying the application data back and forth, once all the syn and ack
packet activity is complete.  But how to do this?  Isn't recipe 17.18
lacking in this detail?

thanks in advance

Tom Christiansen, do you have any comments?


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

Date: Sat, 3 Nov 2001 10:53:23 +1100
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Help modifying a sort routine
Message-Id: <slrn9u6cfj.1rg.mgjv@martien.heliotrope.home>

On Fri, 02 Nov 2001 17:38:50 GMT,
	Tad McClellan <tadmc@augustmail.com> wrote:
> Steffen Müller <tsee@gmx.net> wrote:
> 
>>>      my ($num) = ($#unsorted+1) / ($#db_cols+1);
>>          ^    ^   ^            ^   ^           ^
>>Parens enforce list context. 
>         ^^^^^^^
> 
> That is too strong a term. "Parens allow list context" is more accurate.
> 
> ( and parens do NOT make a list, they are very often needed for
>   precedence reasons though.
> )

I agree, however, in some case they do create list context out of nothing
though, as in the ugly construction:

my $count = () = s#pattern#repl#;

and sometimes they are needed because the operator does something
special:

@lots_of_threes = (3) x 10000;

n neither of these are the parentheses needed for precedence, but in
both they are needed to create a list context (although in the second
example this is a bit debatable, since one could call it special
behaviour of the operator, or a hack).

> For an example of parens that do NOT force a list context, we have
> to look no further than the code above, which contains 2 sets
> of parens (the 2nd two) that do not effect context  :-)
> 
>    my ($num) = (context()) / 10;
>    sub context { print wantarray ? 'list' : 'scalar' }
> 
> shows that context() was called in a scalar context, whether
> wrapped in parens or not.
> 
> What determines the context is the _operators_ involved in the
> part of the expression being evaluated.

And the context some of these operators appear in:

$foo = context(); # scalar context
@foo = context(); # list context

To be complete about what parentheses do and don't do in all the various
situations in Perl, and about what creates a scala, void or list
context, we'd need to rewrite the documentation for Perl. And then some.

>>#!/bin/perl
>>use strict; # always!!!
>>use warnings; # always!!!
> 
> Nothing to add here, but it bears repeating so I'll leave it in  :-)

Ditto.

Martien
-- 
                                | 
Martien Verbruggen              | We are born naked, wet and hungry.
                                | Then things get worse.
                                | 


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

Date: Sat, 3 Nov 2001 02:05:39 +0100
From: "Steffen Müller" <tsee@gmx.net>
Subject: Re: Help modifying a sort routine
Message-Id: <9rvfp6$qam$07$1@news.t-online.com>

"Tad McClellan" <tadmc@augustmail.com> schrieb im Newsbeitrag
news:slrn9u5jd1.dfu.tadmc@tadmc26.august.net...
| Steffen Müller <tsee@gmx.net> wrote:

[...]

| >Parens enforce list context.
|         ^^^^^^^
|
| That is too strong a term. "Parens allow list context" is more accurate.
|
| ( and parens do NOT make a list, they are very often needed for
|   precedence reasons though.
| )

[ example ]

| What determines the context is the _operators_ involved in the
| part of the expression being evaluated.

Tad points out in his reply that it is indeed a pretty odd part of the Perl
syntax. Regardless, I gladly stand corrected.

| Division gives scalar context to both of its operands (but you
| already knew that judging by the code below that I snipped).

Still, explanation might be beneficial to the OP.

[...]

| >#!/bin/perl
| >use strict; # always!!!
| >use warnings; # always!!!
|
| Nothing to add here, but it bears repeating so I'll leave it in  :-)

Umm, yeah, and again.

Steffen
--
$_=q;0cb212c210b0bb010c0113bb0c410c0b516c0bb3d212c2b0b0b016b6cb2b2c21010c0
b41110b3bba0e0c0d2c4b2b6bc013d2c0d0b01012b0b0;;s/\n//g;s/(\d)/$1<2?$1:'0'x
$1/ge;s/([a-f])/'1'x(ord($1)-97)/ge;print"\n";$o=$_;push@o,substr($o,$_*8,
8)for(0..24);for(@o){print"\0"x(26-$i).chr(oct('0b'.($_)))."\n";$i++}#st_m





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

Date: Fri, 2 Nov 2001 18:16:15 -0600
From: "Dan Nguyen" <Dan.Nguyen@lsil.com>
Subject: Re: Is it possible to convert a UNIX shell command into PERL?
Message-Id: <9rvd32$fld$1@news.lsil.com>

Thanks, Dan

"Rafael Garcia-Suarez" <rgarciasuarez@free.fr> wrote in message
news:slrn9u5hpr.pmb.rgarciasuarez@rafael.kazibao.net...
> Dan Nguyen wrote in comp.lang.perl.misc:
> > I would like to convert one of the two lines below from UNIX shell into
perl
> > but I was not able to do it.
> > Please HELP HELP HELP!
> >
> >      find . -name "*.h" -follow -print | sed -e 's/^/\"/;s/$/\"/' |
xargs
> > wc -l | sed '$\!d' | nawk '{print $1}'
>
> A good start is to look at the File::Find perl module, and at the
> find2perl utility, that converts find(1) commands to perl code (that
> uses File::Find).
>
> --
> Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
> But what about a bit of artistic license?
>     -- Monty Python, The Penultimate Supper




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

Date: Fri, 02 Nov 2001 18:25:36 -0500
From: LM <ellem@webcombo.net>
Subject: Re: One liners vs. verbose code
Message-Id: <9ja6utod5vuof13l4keopq9ovh3p28uf4m@4ax.com>

On Fri, 02 Nov 2001 19:32:06 -0000, David Wall <darkon@one.net> wrote
wonderful things about sparkplugs:

>tadmc@augustmail.com (Tad McClellan) wrote on 02 Nov 2001:
>
>> Lou Moran <lmoran@wtsg.com> wrote:
>>>--(This all started when my boss put one of my scripts on a projector
>>>and said to a group (essentially) "I don't want you all coding like
>>>this.  It's too clear." 
>> 
>> 
>[snip] 
>> (It is possible that your paraphrase above does not capture the
>>  essence of what was really said/meant though.
>> )
>
>That occurred to me as well after I'd already posted a followup.  

He's a security through obfuscation (see also Lotus Notes) kind of
guy.  While I wasn't commenting passwords or anything I was explaining
how the script worked to my future (forgetting what I'd
done/stolen/learned) self.

Otherwise he's all right.  I turned him on to Perl and he's been
pretty cool about letting me learn while I work.  (And he got me The
Perl Cookbook for Xmas)


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

Date: Fri, 02 Nov 2001 23:56:36 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: One liners vs. verbose code
Message-Id: <slrn9u6a36.el6.tadmc@tadmc26.august.net>

LM <ellem@webcombo.net> wrote:
>On Fri, 02 Nov 2001 19:32:06 -0000, David Wall <darkon@one.net> wrote
>wonderful things about sparkplugs:
>
>>tadmc@augustmail.com (Tad McClellan) wrote on 02 Nov 2001:
>>
>>> Lou Moran <lmoran@wtsg.com> wrote:
>>>>--(This all started when my boss put one of my scripts on a projector
>>>>and said to a group (essentially) "I don't want you all coding like
>>>>this.  It's too clear." 
>>> 
>>> 
>>[snip] 
>>> (It is possible that your paraphrase above does not capture the
>>>  essence of what was really said/meant though.
>>> )
>>
>>That occurred to me as well after I'd already posted a followup.  
>
>He's a security through obfuscation (see also Lotus Notes) kind of
>guy. 


How do you know about Lou's boss?

Do you work with him?

Or _are_ you him?

If so, you should have said so, and you should either use a deliverable
address or mark it as undeliverable. I tried to ask about your identity
in email instead of posting, but it bounced.


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


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

Date: Fri, 02 Nov 2001 20:56:32 -0500
From: ellem@optonline.net (Lou Moran)
Subject: Re: One liners vs. verbose code
Message-Id: <ellem-0211012056320001@192.168.1.100>

In article <slrn9u6a36.el6.tadmc@tadmc26.august.net>, tadmc@augustmail.com
wrote:

> LM <ellem@webcombo.net> wrote:
SNIP
YIKES!  That is totally wrong

> >He's a security through obfuscation (see also Lotus Notes) kind of
> >guy. 
> 
> 
> How do you know about Lou's boss?
> 
> Do you work with him?
> 
> Or _are_ you him?
> 
> If so, you should have said so, and you should either use a deliverable
> address or mark it as undeliverable. I tried to ask about your identity
> in email instead of posting, but it bounced.

Really sorry.  I thought I posted from my laptop which is my work laptop
from whence I originally posted... but I guess i was on my wife's machine,
now I am on my G4 and I REALLY need to get my settings straightened out..
sorry.

-- 
There's more than one way to do it, mine tend to be wrong


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

Date: Sat, 3 Nov 2001 13:31:02 +1100
From: "oxide" <me@home.com>
Subject: Re: Perl on Windows2000
Message-Id: <3be3576b$0$3436$afc38c87@news.optusnet.com.au>

try a perl ng as this is more s perl question than a w2k question


"Joseph J. Whalen" <joe.whalen@broadbeam.com> wrote in message
news:r1BE7.10825$ym4.472552@iad-read.news.verio.net...
> I am interested in running Perl on Windows 2000 in order to support perl
CGI
> scripts through IIS.  I have a copy of ActivePerl installed on the system.
> In all of the FAQ's that I've seen, it is recommended to also use
> cgi2shell.exe.  I can not seem to find this utility anywhere for download.
> My questions:
>
> 1. Is there someplace this can be downloaded from?  If so, where.
> 2. Are there any other utilities I can use to replace the functionality
> cgi2shell provides?
> 3. Is there another way to get perl CGI's working under IIS other than the
> path that I've taken.
>
> If anyone has any helpful information please feel free to email me.  Thank
> you for any assistance you can provide.
>
>




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

Date: Sat, 03 Nov 2001 03:39:23 +0100
From: "Carsten Menke" <bootsy52@gmx.net>
Subject: Re: reading flat-file db and replacing a word
Message-Id: <pan.2001.11.03.03.39.22.75.2700@gmx.net>

On Fri, 02 Nov 2001 16:12:40 +0100, Tad McClellan wrote:
> 
> I think it does help you, you just didn't recognize it  :-)

Hmmh, maybe I haven't clearly told what I want to do.
OK, Though I will read the FAQ again, I'll tell you in the meanwhile what
I want to do:

I have a CSV File which looks like this

ad001;5;1011002;User X Y,

where the first field contains alphanumeric characters, the second
numeric only, the third numeric with the length of 7, and the 4th cou be
nearly anything.

So I want to change or delete a whole line, but what I actually don't
want to do is, to make temporary copies of the file itself or read the
whole content into an array. Currently I read all into an array, 
but this should be changed as
the filesize increases. Currently the file is only 63K But I think it's
not a good idea of having 500K - 1MB stored into an array on a shared
Host.

So I wonder if there is a way of replacing or deleting a whole line in the text file
without making temporay copies and reading in the whole content into an
array. But as I said, it's too late for today, and I will reread the FAQ.

> If there is something in the FAQ answer that you don't understand, you
> can ask about it here and we'll try and help clarify.

Thanx for the offer :-)

> 
> 
> The FAQ answer gives code that does not read the entire file into an
> array (more than one example even). It shows how to do it with only a
> single line in memory at any time.
> 

> 
> 
> Reread the part that starts with:
>    "(There are exceptions in special circumstances".
> 
Will do it, but tomorrow, today my eyes are flickering because I sad to
much in front of my computer, would be nice if you are there tomorrow,
too.

> 
> 
> I fail to see the shortcomings in the FAQ answer that you allude to.
> 
> What is wrong with the answer given in the FAQ?
> 
>


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

Date: 2 Nov 2001 23:21:23 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Regexp for email address
Message-Id: <1004742145.22485@itz.pp.sci.fi>

In article <Xns914CD02135AF0ccruizermydejacom@24.0.0.25>, Glenn White wrote:
>
>    $fields[$i] =~ s/$fields[$i]/$fields[$i]$default_address/;

This line may not do what you want, if $fields[$i] contains any
characters that are considered special in a regexp.

Other that that, your solution isn't bad at all.  With the above bug
fixed, the while loop replaced with foreach, and a few minor cosmetic
tweaks, it can be made to look like this:

  my @fields = split(/;/, $line);
  foreach (@fields) {
      s/$/$default_address/ unless /\@/;
  }
  $line = join(';', @fields);

That's very much a Perlish solution.  Just because map() and grep() are
there doesn't mean they have to be used for everything.

Just to show one more way to do it:

  $line =~ s/([^;@]+)([^;]*)/$2 ? "$1$2" : "$1$default_address"/eg;

This will break if any of the fields begins with an '@', though.

-- 
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real!  This is a discussion group, not a helpdesk.  You post something,
we discuss its implications.  If the discussion happens to answer a question
you've asked, that's incidental."           -- nobull in comp.lang.perl.misc



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

Date: Sat, 3 Nov 2001 01:01:48 +0200
From: "Stuart Gall" <stuart@otenet.gr>
Subject: Re: Serving HTML images
Message-Id: <9rv9cs$es0$1@usenet.otenet.gr>

"Maarten" <lithotroph@hotmail.com> wrote in message
news:914DBE08A12547@24.132.65.7...
>
> Using perl I'm not sure whether this is the right group to ask, but
> anyway: does anybody know how to get a browser to not load a image
> from the cache but from the server instead while using the html IMG
> tag?
>
Ahh I tried by email, your email is invalid

you need

<META HTTP-EQUIV="pragma" CONTENT="no-cache">
In the header


--

Stuart Gall
------------------------------------------------
This message is not provable.



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

Date: Fri, 2 Nov 2001 23:07:26 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Unsigned 8 bit math (addition and subtraction)
Message-Id: <9rv8ve$cd0$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to
Ilmari Karonen 
<usenet11628@itz.pp.sci.fi>], who wrote in article <1004741348.21037@itz.pp.sci.fi>:
> In fact, looking at the code (pp_modulo in pp.c) in bleadperl, it seems
> it already uses fmod() internally for large numbers -- the operands are
> just truncated to integers before the result is computed.
> 
> IMHO that's silly.

Agreed.  But this was the only way to preserve backward-compatibility...

Ilya


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 2057
***************************************


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