[18907] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1075 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 6 14:11:26 2001

Date: Wed, 6 Jun 2001 11:10:30 -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: <991851030-v10-i1075@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 6 Jun 2001     Volume: 10 Number: 1075

Today's topics:
    Re: Having a difficult time expanding file names (Tad McClellan)
    Re: Help a script to prompt to input and have those inp <c_clarkson@hotmail.com>
        How to get help available on perldoc? <radiotito@yahoo.com>
    Re: How to get help available on perldoc? <der.prinz@gmx.net>
    Re: How to get help available on perldoc? <tschmelter@statesman.com>
    Re: How to get help available on perldoc? <gnarinn@hotmail.com>
    Re: How to get help available on perldoc? <lmoran@wtsg.com>
    Re: How to get help available on perldoc? (Tad McClellan)
    Re: How to get help available on perldoc? (E.Chang)
    Re: How to sort by number first then sort by english na <todd@designsouth.net>
    Re: How to sort by number first then sort by english na (Randal L. Schwartz)
    Re: How to sort by number first then sort by english na (Anno Siegel)
    Re: How to sort by number first then sort by english na <cadmcse@hotmail.com>
    Re: How to sort by number first then sort by english na <todd@designsouth.net>
    Re: How to sort by number first then sort by english na <todd@designsouth.net>
    Re: Intercepting Internet Requests nobull@mail.com
        Is this Perl??? <saras@gj.net>
    Re: Is this Perl??? <gnarinn@hotmail.com>
    Re: Multiple Line printing <todd@designsouth.net>
    Re: Perl is dead! Long live Perl! (Tad McClellan)
    Re: Perl is dead! Long live Perl! <nospam@hotmail.com>
    Re: Perl is dead! Long live Perl! (Randal L. Schwartz)
        PERL/HTML/IIS problems <nospamdd0001@yahoo.com>
    Re: Problems with Threads and Signal handlers <arbman@dhmail.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 6 Jun 2001 10:12:22 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Having a difficult time expanding file names
Message-Id: <slrn9hsei5.4sh.tadmc@tadmc26.august.net>

MondoTrasho <mondotrasho@home.com> wrote:
>I have been a professional software developer for over 20 years, but am
>very new to perl and Linux. I am trying to use the following 
>piece of code to get a list of file names.
>
>..
>while ($fname = <${filepattern}>) {
                  ^^^^^^^^^^^^^^

I'm not sure what your real code is meant to look like.

Does it really use a variable named $filepattern as you have shown?

Or is that a placeholder for what's really there?

   If so, are the curlies also really there, or part of the placeholder?
   Curlies are Perl syntax, so we need to know if they are there.


Angle brackets are overloaded in Perl.

You have not given enough information to determine which function
you are really using.

   <INPUT>   "line" input   (perldoc -f readline)

   <$somevar>  input via indirect filehandle (as you have above)

   <*.txt>   filename globbing (perldoc -f glob)


>	print "$fname\n";
>}
>...
>
>This is working, 
 ^^^^

Then "this" (your real code) is not "that" (the code you have shown above).

I think you tried to use a meta thingie there, but happened to
choose a markup that could be interpreted as Perl syntax.

Please show real code.

If the above _is_ real code, then what is in the $filepattern variable?


>as long as the file pattern does not
>contain any spaces. 


If you are using an indirect filehandle (like you have shown above),
then you are not allowed to have any spaces, because filehandle names
cannot contain spaces.

But I expect you are really trying to do filename globbing.

I generally avoid globbing and use opendir/readdir/grep as Tina
suggested. But in "dirty hacks" where I _do_ use globbing, I
always use the named form instead of angle brackets:

   while ($fname =  glob ${filepattern} ) {

>What can I do if I need spaces in the file pattern?


It depends on what you want the spaces to mean.

If you want their "normal" glob meaning of "separates glob patterns"
(eg: glob '*.txt *.html') then you don't need to do anything special.

So you must want spaces to be characters matched in the filenames
instead of argument separators. In that case, you quote them as
you would in a csh:

   glob "'My *'"; # files that start with these 3 chars: "M", "y" and space


>Just a nudge in the right direction should suffice. Thank you very much.


The "right direction" (IMO) would be to use dirhandles instead of globbing.

Quote the patterns that contain spaces if you insist on using glob().


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


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

Date: Wed, 6 Jun 2001 11:35:18 -0500
From: "Charles K. Clarkson" <c_clarkson@hotmail.com>
Subject: Re: Help a script to prompt to input and have those input add or append certain lines in a text file
Message-Id: <1280C29E812F1DE4.186890C52F856474.4FD9448D505DE528@lp.airnews.net>

David Combs <dkcombs@panix.com> wrote:
: Charles K. Clarkson <c_clarkson@hotmail.com> wrote:
: >
: >"Steve" <stpham@qwest.net> wrote in message
: >news:P9QO6.220$a32.34759@news.uswest.net...
: >: Hi all,
: >:
: >: I am new to perl and I need help to write to perl script
: >: that will ask certain values and have those values enter
: >: or modify on a certain of a specific text file.
: >:
: >: For example: Let say I have a text file that looks like
: >: this when I open with a notepad.
: >: [snip]
: >: I would I go about writting a perl script to do
: >: that I think you are a perl programmer it would not
: >: be so hard to write this script.
: 
: First, learn some real EDITOR -- especially, a general-purpose
: one, like vi or vim or emacs (for NT or unix) or whatever
: programmers use on pc/M$ machines.  VI or VIM might be
: your best bet, considering you want to learn perl,
: because lots of the regex concepts for substition
: are the same, and likely where perl's originally
: were based on.
: >
: >    I wrote a short sub to do just this when I was
: >learning about wantarray, please feel free to fold,
: >spindle, and mutilate it to your hearts content.
: >
: >    You can find it at:
: ><http://groups.yahoo.com/group/perl-beginner/files/ini.pl.txt>
: >
: 
: Uh, what I find there is some BS about signing up
: for a yahoo listserv, creating one -- or maybe it's
: just for free email.  Didn't look closely.
: 
: But for sure it was NOT anything to do with PERL!
: 
: Now, problem is probably that I use LYNX as browser
: (from a shell-acct on my ISP), and lynx understands
: nothing about javascript -- just plain html, not even
: 2-dim tables.
: 
: Have you a better url for the above?

    Sorry, I knew Yahoo was a pain, just not that big a
pain. It's also at:

    <http://www.clarkson1.com/source/ini.pl.txt>

HTH,
Charles K. Clarkson






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

Date: Wed, 06 Jun 2001 18:36:55 +0200
From: Valentin 30IR976 <radiotito@yahoo.com>
Subject: How to get help available on perldoc?
Message-Id: <3B1E5C27.8234A8CA@yahoo.com>

Hello people. I use perldoc to get help about perl, eg: "perldoc
perlfunc", and I know that I can also query about "perldoc perlop",
etc...But, are there a perldoc option to get all the things I can get
help with perldoc? Eg: Something like "perldoc
list_PERLDOC_help_available"

Many thanks in advance...
Tito



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

Date: Wed, 6 Jun 2001 19:13:56 +0200
From: "Stefan Weiss" <der.prinz@gmx.net>
Subject: Re: How to get help available on perldoc?
Message-Id: <3b1e6494$1@e-post.inode.at>

Valentin 30IR976 <radiotito@yahoo.com> wrote:

> Hello people. I use perldoc to get help about perl, eg: "perldoc
> perlfunc", and I know that I can also query about "perldoc perlop",
> etc...But, are there a perldoc option to get all the things I can get
> help with perldoc? Eg: Something like "perldoc
> list_PERLDOC_help_available"

perldoc perl

cheers,
stefan





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

Date: Wed, 06 Jun 2001 17:15:46 GMT
From: Tim Schmelter <tschmelter@statesman.com>
Subject: Re: How to get help available on perldoc?
Message-Id: <3B1E6542.A3D5C297@statesman.com>

Valentin 30IR976 wrote:

> Hello people. I use perldoc to get help about perl, eg: "perldoc
> perlfunc", and I know that I can also query about "perldoc perlop",
> etc...But, are there a perldoc option to get all the things I can get
> help with perldoc? Eg: Something like "perldoc
> list_PERLDOC_help_available"
>
> Many thanks in advance...
> Tito

Try the obvious: perldoc perldoc

--
Tim Schmelter
tschmelter@statesman.com
Public Key available from http://www.keyserver.net
CAD7 2ABB 05A4 2F00 4CAE  7D2F 127C 129A 7173 2951




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

Date: Wed, 6 Jun 2001 16:51:06 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: How to get help available on perldoc?
Message-Id: <991846266.745311795268208.gnarinn@hotmail.com>

In article <3B1E5C27.8234A8CA@yahoo.com>,
Valentin 30IR976  <radiotito@yahoo.com> wrote:
>Hello people. I use perldoc to get help about perl, eg: "perldoc
>perlfunc", and I know that I can also query about "perldoc perlop",
>etc...But, are there a perldoc option to get all the things I can get
>help with perldoc? Eg: Something like "perldoc
>list_PERLDOC_help_available"
>

indeed: perldoc perl

>Many thanks in advance...

welcome

>Tito
>

gnari


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

Date: Wed, 06 Jun 2001 13:24:47 -0400
From: Lou Moran <lmoran@wtsg.com>
Subject: Re: How to get help available on perldoc?
Message-Id: <hppshtotnubgtu964ddh613255la36kkuo@4ax.com>

On Wed, 06 Jun 2001 18:36:55 +0200, Valentin 30IR976
<radiotito@yahoo.com> wrote wonderful things about sparkplugs:

>Hello people. I use perldoc to get help about perl, eg: "perldoc
>perlfunc", and I know that I can also query about "perldoc perlop",
>etc...But, are there a perldoc option to get all the things I can get
>help with perldoc? Eg: Something like "perldoc
>list_PERLDOC_help_available"

perldoc perldoc

Also check put http://www.perldoc.com
>
>Many thanks in advance...
>Tito

--
BSOD? In my day we didn't have 0000FF!
lmoran@wtsg.com


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

Date: Wed, 6 Jun 2001 12:34:02 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: How to get help available on perldoc?
Message-Id: <slrn9hsmrq.56k.tadmc@tadmc26.august.net>

Valentin 30IR976 <radiotito@yahoo.com> wrote:

>are there a perldoc option to get all the things I can get
>help with perldoc?

   perldoc perldoc

Are you making a groaning sound about now?  <grin>


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


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

Date: Wed, 06 Jun 2001 17:56:09 GMT
From: echang@netstorm.net (E.Chang)
Subject: Re: How to get help available on perldoc?
Message-Id: <Xns90B88E41DEC45echangnetstormnet@207.106.92.86>

Valentin 30IR976 <radiotito@yahoo.com> wrote in 
<3B1E5C27.8234A8CA@yahoo.com>:

> Hello people. I use perldoc to get help about perl, eg: "perldoc
> perlfunc", and I know that I can also query about "perldoc perlop",
> etc...But, are there a perldoc option to get all the things I can get
> help with perldoc? Eg: Something like "perldoc
> list_PERLDOC_help_available"
> 
> Many thanks in advance...
> Tito
> 
perldoc perldoc will tell you all the options for using perldoc.

perldoc perl will show you all of the stardard documentation available.

perldoc perlmodlib gives the list of modules that are part of the Perl 
module library.

perldoc perllocal gives a list of modules that were installed
locally (using CPAN).

Incidentally, I discovered the last two by doing a search of clpm on 
groups.google.com - there were 984 previous posts addressing how to 
find a list of installed modules.

-- 
EBC


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

Date: Wed, 06 Jun 2001 15:23:36 GMT
From: "Todd Smith" <todd@designsouth.net>
Subject: Re: How to sort by number first then sort by english name?
Message-Id: <YVrT6.118221$I5.27394236@news1.rdc1.tn.home.com>


"jack" <cad@uk2.net> wrote in message
news:OUmT6.61416$ko.984916@news1.frmt1.sfba.home.com...

> I need to sort 2 times to change the print out order
> first sort by number(right side) , and after that,,
> sort by english name(left name)
> then print the $out,
>
> _DATA_
> core1Kx256 3
> sect256 0
> core1Kx128 3
> sect128 0

so do this:

@sorted = sort {
    chomp ($a, $b);
    @a = split /\s+/, $a;
    @b = split /\s+/, $b;
    $a[1] <=> $b[1] or
    $a[0] cmp $b[0]
} (<DATA>);

-todd




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

Date: 06 Jun 2001 08:34:23 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: How to sort by number first then sort by english name?
Message-Id: <m1iti9aagw.fsf@halfdome.holdit.com>

>>>>> "Todd" == Todd Smith <todd@designsouth.net> writes:

Todd> so do this:

Todd> @sorted = sort {
Todd>     chomp ($a, $b);

Don't do that.  You've just altered the original values in the source
list.  Repeatedly. :)

Todd>     @a = split /\s+/, $a;
Todd>     @b = split /\s+/, $b;
Todd>     $a[1] <=> $b[1] or
Todd>     $a[0] cmp $b[0]
Todd> } (<DATA>);



-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: 6 Jun 2001 16:08:04 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How to sort by number first then sort by english name?
Message-Id: <9flkh4$ooh$1@mamenchi.zrz.TU-Berlin.DE>

According to Randal L. Schwartz <merlyn@stonehenge.com>:
> >>>>> "Todd" == Todd Smith <todd@designsouth.net> writes:
> 
> Todd> so do this:
> 
> Todd> @sorted = sort {
> Todd>     chomp ($a, $b);
> 
> Don't do that.  You've just altered the original values in the source
> list.  Repeatedly. :)

[reasonable rest of sort routine snipped]

There are times when do-what-i-mean is a curse and no blessing, and
this is an example.

The placement of chomp in a sort routine is clearly wrong, not to
mention inefficient and ugly.  Yet the DWIMmish nature of chomp
(only chop $/ if it is there) lets a naive programmer get away with
it and never notice something's amiss.  Then the code spreads...

Good old chop would at least have left traces.

Anno


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

Date: Wed, 6 Jun 2001 11:03:00 -0700
From: "cadfei" <cadmcse@hotmail.com>
Subject: Re: How to sort by number first then sort by english name?
Message-Id: <9flqqh$ic2$1@taliesin.netcom.net.uk>

while(<IN>) {
if(s/^\s+//){chomp ;}  #remove empty line
if(/^(\S+)(\s+)(\S+)/){
 $name=$1; $num=$3;
$index = "$num$name";
 $data{$index} = "$name $num\n"

}
}
foreach $c (sort(keys %data)){print $data{$c};}





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

Date: Wed, 06 Jun 2001 17:59:45 GMT
From: "Todd Smith" <todd@designsouth.net>
Subject: Re: How to sort by number first then sort by english name?
Message-Id: <lcuT6.119115$I5.27473008@news1.rdc1.tn.home.com>


"Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
news:9flkh4$ooh$1@mamenchi.zrz.TU-Berlin.DE...
>
> The placement of chomp in a sort routine is clearly wrong, not to
> mention inefficient and ugly.  Yet the DWIMmish nature of chomp
> (only chop $/ if it is there) lets a naive programmer get away with
> it and never notice something's amiss.  Then the code spreads...
>
> Good old chop would at least have left traces.
>

So it's naive to use chomp even though that's what it's there for? I think
it would be stupid to not use it just because chop can do the same thing
with more code. There's always a way to do something with more code, but
that doesn't mean it's better.

And you think that

chomp ($a, $b);

is uglier than

chop $a while $a =~ /\n$/;
chop $b while $b =~ /\n$/;

I don't think so.




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

Date: Wed, 06 Jun 2001 18:03:36 GMT
From: "Todd Smith" <todd@designsouth.net>
Subject: Re: How to sort by number first then sort by english name?
Message-Id: <YfuT6.119141$I5.27474418@news1.rdc1.tn.home.com>


"Randal L. Schwartz" <merlyn@stonehenge.com> wrote in message
news:m1iti9aagw.fsf@halfdome.holdit.com...
> >>>>> "Todd" == Todd Smith <todd@designsouth.net> writes:
>
> Todd> so do this:
>
> Todd> @sorted = sort {
> Todd>     chomp ($a, $b);
>
> Don't do that.  You've just altered the original values in the source
> list.  Repeatedly. :)
>

I didn't want to do a numeric compare on two strings with newlines, even if
they do evaluate out to be numbers.






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

Date: 06 Jun 2001 18:20:59 +0100
From: nobull@mail.com
Subject: Re: Intercepting Internet Requests
Message-Id: <u97kypzfr8.fsf@wcl-l.bham.ac.uk>

babberc@yahoo.co.uk (Babber) writes:

> Newsgroups: comp.lang.perl.misc

This is a newsgroup about Perl.

> I want to know how to intercept what is sent to the web
> site when the "search" button on Internet Explorer is pressed...

This is a question about IE, it has nothing whatever to do with Perl.

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


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

Date: Wed, 6 Jun 2001 09:57:57 -0600
From: "sas" <saras@gj.net>
Subject: Is this Perl???
Message-Id: <3b1e5365$1@news.gj.net>

Is this a Perl Script?
++++++++
1:  r+ERROR: Tried to open %s . %s. (error number %d)
2:  ./newnum.lst-d%s %d
3:  PLEASE ENTER EMPLOYEES' FULL NAME: "%s", Is this correct [y/n] :
4:  "%s" is already in list file with number %d.
5:
6:  New number for "%s" is %d. Adding new number to list.
7:  %s,%d
8:  ~
++++++++
(The file: newnum.lst referred to is a list of names & randomly generated
numbers; here is a portion of that file:)
*********
SECURITY NUMBER 1,99999
SECURITY NUMBER 2,77771
ALICE A. SUNDEEN,24256
ALICE F. NEWCOMB,32065
ALICE M. BROUHARD,16310
AMY E. HORNER,39967
ANDREW R. SHIVELY,16078
ANGELA DAWN ENDERS,36528
ANIE ANNE CARLSON-CRANDALL,12885
ANN DENISE LEWIS,29823
ANN MICHELLE DOBBS,24913
ANN S. HOPKINSON,26672
ANNE C. REID,19287
ANNE I. ANDERSEN,19519
ANNE L. WILBURN,18100
ANNE R. WILLIAMS,13755
ANNE T. WOJCIK,41519
ANYA V. DERKASH,35070
AUDREY K. SPAULDING,20621
BARB VISSER,30616
BARBARA A BUSH,24252
BARBARA A. BRANDENBURG,14493
BARBARA A. CEBULA-MC CUNE,40417
BARBARA A. POECKES,31582
BARBARA H. HENTHORN,38059
BARBARA J. REINKE,36125
************
 Any feedback will be appreciated. This is currently running on a Unix
server.
Thanks
Sara S.
saras@ruralhealth.org




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

Date: Wed, 6 Jun 2001 16:45:03 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: Is this Perl???
Message-Id: <991845903.183064170181751.gnarinn@hotmail.com>

In article <3b1e5365$1@news.gj.net>, sas <saras@gj.net> wrote:
>Is this a Perl Script?
>++++++++
>1:  r+ERROR: Tried to open %s . %s. (error number %d)
>2:  ./newnum.lst-d%s %d
>3:  PLEASE ENTER EMPLOYEES' FULL NAME: "%s", Is this correct [y/n] :
>4:  "%s" is already in list file with number %d.
>5:
>6:  New number for "%s" is %d. Adding new number to list.
>7:  %s,%d
>8:  ~
>++++++++

no, this is not perl

this looks to me like a datafile containing strings to be used
with printf or sprintf

> Any feedback will be appreciated. This is currently running on a Unix
>server.

what do you mean by 'running' ?

good luck with whatever you are doing.
gnari




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

Date: Wed, 06 Jun 2001 15:47:01 GMT
From: "Todd Smith" <todd@designsouth.net>
Subject: Re: Multiple Line printing
Message-Id: <VfsT6.118268$I5.27407347@news1.rdc1.tn.home.com>


"David Combs" <dkcombs@panix.com> wrote in message
news:9fkm4t$qb8$1@news.panix.com...
> In article <a2051d6.0105230401.5f5a46c7@posting.google.com>,
> Gary <grobitaille@mail.com> wrote:
> >I need to parse a text file and when a pattern is matched I need to
> >print that line and the next 6 lines. Can someone provide me with a
> >perl solution
> >
> >

here's non-tested code:

@lines = <FILE>;
$print = 0;

for (@lines) {
    $print += 6 if /pattern/;
    if ($print) {
        print;
        --$print;
    }
}

That might work for ya




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

Date: Wed, 6 Jun 2001 11:40:35 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Perl is dead! Long live Perl!
Message-Id: <slrn9hsjnj.4sh.tadmc@tadmc26.august.net>

Andrew Lee <spamnoo@earthlink.net> wrote:
>Now that corporate reins are tightened and Java is all the rage -- what
>manager would invite chaos into her/his system with crazy Perl hacks?


A manager concerned with the amount of payroll perhaps.

Or a technical manager who may have seen this wisdom on Usenet:

   "Java is a bad hack and is for kids who aren't sharp enough to do C++."


>So much better to leave the mind behind 


Do you think that potential employers might do a Google search for 
"Perl Andrew Lee" now or in the future? 

Or "Java Andrew Lee", should you decide to switch languages in 
order to feed yourself or your family? Does the above quotation, 
along with this Perl one, look like the charred remains of a
bridge to you? They do to me.

Think what they find will help your chances of getting out of that line?

I wonder what any other "Andrew Lee"s who are found might think
(or even do) about being so associated?


I think you have temporarily left _your_ mind behind. You should count
to 10 (maybe more than once) before you put something into a 
semi-permanent searchable archive.

Get a grip. Consider your own self interests coldly.


>Beware beware ... Perl angels look down upon us -- from the unemployment
>line.


sniff... what is that scent?


>Larry and Tom and Randall have gigs -- what about you?  Your manager is
>willing to support your crazy Perl antics?  


My manager(s) supports Perl sure enough.

You have named one of them above, so we'll disregard that one
as a special case  :-)

The other managers like to pay 1 Perl programmer rather than 3 Java
programmers at the end of each month. (for many (most?) things. They
have Java programmers on hand too generally).


>When will he do the RIGHT
>thing and turn to Java???


Business folk want to minimize costs as much as is practicable.

They will turn to Java when they can get their work done more
cheaply with Java.

Or, they may just follow the brainwashing hype as your satire
that I snipped addressed.

I expect some will do one, some will do the other. The real
question is: to what scale and in what proportions?


>Come -- join me on the unemployment line!  


Aha! The smell of sour grapes, that's what it is.

I knew that scent was familiar somehow...


>Be a statistic!  Be all that
>this horrible language can let you be!


This horrible language has supported my family in fine style for
several years, and is still working out fine.

I'm sorry to hear that it is not the same for you, but your posting(s)
seem to be shading away from, rather than toward, getting some sort
of employment.


>So!  Stop talking!!!! and get in the unemployment line!!!!  Learn to
>flip burgers with regular expressions -- it is all the rave!


You can flip burgers with 22 characters of Perl.

   s/burgers/reverse$&/e;

If anyone knows Java well, please post the guts of what it would
take to get that done in Java.


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


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

Date: Wed, 6 Jun 2001 11:50:40 -0500
From: Mr. SunRay <nospam@hotmail.com>
Subject: Re: Perl is dead! Long live Perl!
Message-Id: <zbtT6.834$Dv6.113230@news.uswest.net>

> >So!  Stop talking!!!! and get in the unemployment line!!!!  Learn to
> >flip burgers with regular expressions -- it is all the rave!
> 
> 
> You can flip burgers with 22 characters of Perl.
> 
>    s/burgers/reverse$&/e;
> 
> If anyone knows Java well, please post the guts of what it would
> take to get that done in Java.
> 

Uh, I would, but I can't seem to remember which of the 37 string types I need 
to use.

:P

Mr. Sunray

ADA was never alive!  Long live ADA! (95, that is)




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

Date: 06 Jun 2001 10:37:46 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Perl is dead! Long live Perl!
Message-Id: <m1u21t7bmd.fsf@halfdome.holdit.com>

>>>>> "SunRay" == SunRay  <nospam@hotmail.com> writes:

SunRay> Uh, I would, but I can't seem to remember which of the 37
SunRay> string types I need to use.

"Of course Java uses strong typing!
 I'm *always* pounding the keyboard when I use it!"

:-)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Wed, 6 Jun 2001 17:13:36 GMT
From: David <nospamdd0001@yahoo.com>
Subject: PERL/HTML/IIS problems
Message-Id: <3B1E64C0.FB3739A3@yahoo.com>

I am trying to use PERL on an NT server to generate HTML.  My company
has a huge network with lots of file servers.  I want it to read a
folder on a server 
to which the users have access, create a pull-down with all the files in
that folder, and allow the user to pick and load a file.
I want to provide a convenient interface for users to access files
located on different servers without them having to remember the server
name
and share, map the server under windows, and navigate there.  There are
two problems:

1) The web server doesn't seem to be able to access the data server
2) I can't figure out what kind of JavaScript code should go into the
onChange event to get it to load the file with the appropriate
application.
(This is easy using straight html).

Any help would be appreciated.

Here are some comments from a company Newsgroup:

	David wrote:
	> 
	> I don't have my own account on the server, but I have access to it. 
I
	> can read and write the files for my website.
	> but that sounds like its running under the IIS/Server account.
	> 
	> Shouldn't it still be able to read a public folder?
	
	Well that depends on how you define "public."  If the permissions on
the
	folder are such that group Everyone has access to it, then yes, it
	should work.  But the account IIS uses when running your script is a
	local account that exists only on that NT web server.  As such, you
	can't assign it permissions on another box since it's not viewable
	outside of the current server (it's not a domain account.)
	
	See URL below for more info.
	

http://support.microsoft.com/support/kb/articles/Q188/7/12.ASP?LN=EN-US&SD=gn&FR=0&qry=iusr&rnk=11&src=DHCS_MSPSS_gn_SRCH&SPR=MSALL


This is the PERL code.
-----------------------------------------------------------------------------------------------------------------------

use English; # English language OS error message module
print "Content-type:text/html\n\n";

# ---- Declarations -----
# Base directory for files is dir. from which the .pl was loaded, but
base dir for the HTML
# generated by the .pl is the dir. .pl is located.

# This is a valid file server on my company's network.  I have access to
it, but I'm not sure the server can access it.
# I had to escape each of the backslashes
$sepgDir =
"\\\\filserver-0302\\share1\\folder_1\\subfolder_1\\WordTemplates";

# $sepgDir = ".\\WEBSITES\\myWebsite"; # this one actually works.  It
references a valid folder on the NT server itself.


print <<EOF;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
# etc. etc.
# this is all the stuff for an html header
EOF

# This always fails:  It writes out this message: can't open
\\fil-nw03-02\cscmm\SEPG_processes\core_SEPG\SEPG_process_tool_box\approved\templates:
No such file or directory
opendir (SEPGDIR, $sepgDir) or die "can't open $sepgDir: $OS_ERROR\n";

# I can get to the following code if I use the following to reference to
the web server itself
# $sepgDir = ".\\CSIS\\procmgt"; 

@sepgFiles = readdir (SEPGDIR);

# I want to create a pull-down to select a file, but I can't figure out
how to launch the file.  Most of them will simply be .doc, .ppt, or .xls
#
print '<form name="sepgFiles">', "\n";
print '  <select name="sepgSelect"', "\n";
print '  	 
onChange="if(this.options[this.selectedIndex].value!=\'$\')', "\n";
print '				 {fileName = \'', $sepgDir, "'",  ' + \'\\\\\' +
this.options[this.selectedIndex].value; location.href = \'file:\' +
fileName }', "\n";
print '				">', "\n";
print '    <option selected value="\$">Templates for PMIP</option>',
"\n";

foreach (@sepgFiles)
{
print '    <option value=', $_, '>', $_, '</option>', "\n";
};
print '  </select>', "\n";
print '</form>', "\n";

print <<EOF;
# etc. etc.
# this is all the junk that finishes out the html
EOF


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

Date: Wed, 06 Jun 2001 17:01:01 +0200
From: Scott Rutherford <arbman@dhmail.net>
Subject: Re: Problems with Threads and Signal handlers
Message-Id: <3B1E45AD.CAD38159@dhmail.net>

Dan Sugalski wrote:

>
>
> Signals work rather differently with threads enabled then they do in a
> non-threaded program. (And it's rather platform-dependent on top of
> it)
>
> The only really safe way to handle signals with threads is to use
> a signal-handling thread. Thread::Signal will do this, though I'm
> not 100% sure it works.

Cheers for that Dan, found the Thread::Signal man page, not the most
informative piece of documentation, so I'll give it go and see.

> (And things are different again if you're
> running on Linux, as it handles signals in a threaded program in
> a distinctly non-POSIX way)

Is there a good source for information like that?

>                                         Dan



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

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


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