[7987] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1612 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 9 23:07:31 1998

Date: Fri, 9 Jan 98 20:00:19 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 9 Jan 1998     Volume: 8 Number: 1612

Today's topics:
     Re: CGI.pm - parameters duplicated in querystring and p (William R. Ward)
     Re: CGI.pm - parameters duplicated in querystring and p (brian d foy)
     Re: CGI.pm checkboxes: how to create labels for redunda (William R. Ward)
     Re: Convert .bmp to .jpg via Perl (William Byrd)
     Re: How to send parameters to a perl script. (William Byrd)
     How to Use Perl to Summarize a Bit of Text Output (Kevin M Simonson)
     Need REDIRECT Help!!! <dsuden@netnet.net>
     Parsing a log file with / / (Mark Thompson)
     Re: Parsing a log file with / / (Mark Thompson)
     Re: Pattern Matching (Brock Sides)
     Re: Perl for Engineering purposes (Terry Michael Fletcher - PCD ~)
     Re: Problem with Getopt::Std (Matthew Cravit)
     Recursing Directories in Search of Files, maybe? (Don)
     Re: regex to escape {, } except in TeX commands <ajohnson@gpu.srv.ualberta.ca>
     Re: req: A) Perl/Tk B) Permanter Perl-Interpreter unter <mhazen@franklin.uga.edu>
     Re: Simple string length <ajohnson@gpu.srv.ualberta.ca>
     Re: UNIX commands via FTP on a MACINTOSH -- HAY-ELP! (Paul J. Schinder)
     Re: UNIX commands via FTP on a MACINTOSH -- HAY-ELP! (brian d foy)
     Re: weird problem! (Craig Berry)
     Re: weird problem! (Robert Zilbauer)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 09 Jan 1998 19:02:58 -0800
From: hermit@cats.ucsc.edu (William R. Ward)
Subject: Re: CGI.pm - parameters duplicated in querystring and post input
Message-Id: <waalnwphvz1.fsf@ese.UCSC.EDU>

comdog@computerdog.com (brian d foy) writes:
> CGI.pm has the unfortunate feature of combining query string data
> and http message body data.  if i use an off-the-shelf CGI.pm, then
> i use PATH_INFO instead.  otherwise i hack CGI.pm to not make a stew
> of my data :)

Have you spoken to L. Stein about this?  Perhaps there is some way
that CGI.pm can be modfied to accomodate this, perhaps as an option.

--Bill.

-- 
William R Ward          Bay View Consulting   http://www.bayview.com/~hermit/
hermit@bayview.com     1803 Mission St. #339        voicemail +1 408/479-4072
hermit@cats.ucsc.edu  Santa Cruz CA 95060 USA           pager +1 408/458-8862
 PGP Key 0x2BD331E5; Public key at http://www.bayview.com/~hermit/pubkey.txt


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

Date: Fri, 09 Jan 1998 22:46:27 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: CGI.pm - parameters duplicated in querystring and post input
Message-Id: <comdog-0901982246270001@news.panix.com>
Keywords: just another new york perl hacker

In article <waalnwphvz1.fsf@ese.UCSC.EDU>, hermit@cats.ucsc.edu (William R. Ward) posted:

> comdog@computerdog.com (brian d foy) writes:
> > CGI.pm has the unfortunate feature of combining query string data
> > and http message body data.  if i use an off-the-shelf CGI.pm, then
> > i use PATH_INFO instead.  otherwise i hack CGI.pm to not make a stew
> > of my data :)
> 
> Have you spoken to L. Stein about this?  Perhaps there is some way
> that CGI.pm can be modfied to accomodate this, perhaps as an option.

i don't think that there is a good solution to this problem, at least
one the will have the simplicity of CGI.pm.  since CGI.pm is good
enough for most people, i don't think it's that important.

-- 
brian d foy                                 <http://computerdog.com>


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

Date: 09 Jan 1998 18:58:15 -0800
From: hermit@cats.ucsc.edu (William R. Ward)
Subject: Re: CGI.pm checkboxes: how to create labels for redundant values?
Message-Id: <waapvm1hw6w.fsf@ese.UCSC.EDU>

Chris Schoenfeld <chris@ixlabs.com> writes:
> In the -values field of FORM elements - checkboxes, for example, the
> values are the keys and the labels are the values of the hashref.
> 
> Therefore values must be unique in order to have labels.
> 
> But I'd like the possibility of values to be redundant for quiz scoring
> where answers are not boolean but weighted.
> (for instance, two answers to the same question have the same value).

Why not name them 1a, 1b, 1c, 1d (where 1 is the value and abcd are
literal letters), and then in your processing script you can either
strip off the abcd explicitly or just trust that 1a == 1b and so on
(Perl scans until the first non-numeric character when converting
strings to numbers, IIRC).

--Bill.

-- 
William R Ward          Bay View Consulting   http://www.bayview.com/~hermit/
hermit@bayview.com     1803 Mission St. #339        voicemail +1 408/479-4072
hermit@cats.ucsc.edu  Santa Cruz CA 95060 USA           pager +1 408/458-8862
 PGP Key 0x2BD331E5; Public key at http://www.bayview.com/~hermit/pubkey.txt


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

Date: Sat, 10 Jan 1998 04:30:22 GMT
From: wcb4@erols.com (William Byrd)
Subject: Re: Convert .bmp to .jpg via Perl
Message-Id: <696nk4$l9b$1@winter.news.erols.com>

On 8 Jan 1998 06:51:25 GMT, eric@garlic.com (Eric Hilding) wrote:

>Does anyone know if a .bmp graphic file can be 
>converted to a .jpg format with a perl script...
>or if something like this has already been done?  
>
>It may sound bizarre, but would solve a problem
>in lieu of having to manually convert umpteen 
>files manually in a Windoze graphics program.
>
>Tnx.
>
>Eric
>
>
>


if you are using a win 95 box, look for gds, its a great file
viewer/cataloger/converter. It can be told to convert a file from one
format to another via command line switches, which can be called using
the perl exec command.




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

Date: Sat, 10 Jan 1998 04:49:21 GMT
From: wcb4@erols.com (William Byrd)
Subject: Re: How to send parameters to a perl script.
Message-Id: <696onn$l9b$2@winter.news.erols.com>

On Fri, 09 Jan 1998 16:03:02 GMT, dico@peionline.com (Dico Reyers)
wrote:

>Hi there,
>
>I am looking to build a perl script which will calculate some
>information for me.
>
>The way it should work is like this...
>
>there are many different icons a person can click on and it will load
>up a perl script (always the same script).  The thing is that the
>script should know which icon is calling the script.
>
>for example, if I had this in my html....
>
><a href="bin/xxxx.cgi"><img src="icon1.gif"></a>
>
>when someone clicks on this link, the script should know that it is
>icon1.gif which they clicked.  similary there would be other links
>like above with icon2.gif and icon3.gif.
>
>how can I let the script know which one the person clicked on? and
>finally, how does this show up when the script is run?  in other
>words, what line of code is needed to for me to know which icon they
>pressed.
>
>Thanks in advance,
>
>Dico
this realy should be asked on comp.infosystems.authoring.cgi, but,
I'll give it a stab as I have done this many many times

<a href="/bin/xxxx.cgi?icon=1"><img src="icon1.gif"></a>
<a href="/bin/xxxx.cgi?icon=2"><img src="icon2.gif"></a>
<a href="/bin/xxxx.cgi?icon=3"><img src="icon3.gif"></a>.....
etc ad infinitum, ad nauseum....


the cgi script can use cgi.pm or cgi-libs readparse to find the value
of icon as passed back to it and do whatever based upon what the value
is. If you have a large number of graphics, a perl script can make the
html easily enough.


hope it helps

wcb4@erols.com



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

Date: 10 Jan 1998 02:41:58 GMT
From: simonsen_nospam@skopen.dseg.ti.com (Kevin M Simonson)
Subject: How to Use Perl to Summarize a Bit of Text Output
Message-Id: <696n5m$fnp@sf18.dseg.ti.com>
Keywords: text process summarize

     When I took the "perl" introductory class, the instructor told us that
this language really shone when it came to text processing.  Unfortunately,
that was a part of the class I had a hard time understanding.  Now I'm up
against a text processing problem so I'm thinking the time has come to
learn how "perl" helps with this kind of a job.  Could someone give me a
pointer as to what I need to do to solve my problem?  Feel free to post to
this thread or to e-mail me at "smnsn@skopen.dseg.ti.com".

     My problem is the following.

     As input I have a file with a lot of text in it.  There are two kinds
of lines I'm interested in, both farely well defined.  The first is each
line whose third through eighth characters are the string "_test/" followed
by a string of lower case letters interspersed with slashes, and this whole
thing followed by a space.  The second type of line begins with
"     Time elapsed = ".

     I need to check to make sure that these lines occur in pairs.  If I
locate all lines of this type in the input file, each odd numbered line
(the first, the third, the fifth, etc.) needs to be a line of the first
type and each even numbered line needs to be a line of the second kind.  If
they occur in a different order, I need to generate an error message.

     Assuming they occur in the right order, then what I need to do is form
one line of output for each pair of lines of these types.  I need to start
with the slash-delimited lower case letters at the beginning of the first
type of line (including the first two letters in the line--which by the way
have to be lower case letters), then add a few characters from the end of
that line enclosed in square brackets, and then add the characters immedi-
ately after the "     Time elapsed = " on the second kind of line, but be-
fore the first occurrence of the string "ns".

     For example, if the lines I'm reading in are:

,--------------------------------------------------------------------------.
|gb_test/mdmab/res/mstride.res ++ EXIT STATUS = 0A100000 ++ TEST PASSED    |
|     Start time = Fri Jan 9 11:43:24 CST 1998                             |
|     Stop time = Fri Jan 9 15:16:13 CST 1998                              |
|stty: TCGETS: Operation not supported on socket                           |
|     Total CPU time of './gb_test/mdmab/res/mstride.res' was 00.0         |
|     Time elapsed = 1206735 ns  ::  Number clocks = 120673                |
|     Test bench =                                                         |
|gb_test/timer/res/timer_tst1.res ++ EXIT STATUS = 0A100000 ++ TEST PASSED |
|     Start time = Fri Jan 9 11:42:22 CST 1998                             |
|     Stop time = Fri Jan 9 13:07:05 CST 1998                              |
|stty: TCGETS: Operation not supported on socket                           |
|     Total CPU time of './gb_test/timer/res/timer_tst1.res' was 00.0      |
|     Time elapsed = 460315 ns  ::  Number clocks = 46031                  |
|     Test bench =                                                         |
`--------------------------------------------------------------------------'

then the two lines of output I need are:

,---------------------------------------------------.
|gb_test/mdmab/res/mstride.res [PASSED] [1206735]   |
|gb_test/timer/res/timer_tst1.res [PASSED] [460315] |
`---------------------------------------------------'

     Could some of you give me some advice on how I could write a "perl"
script to do this?  Thanks in advance.

                                     ---Kevin Simonson
 -------------------------------------------------------------------------
     Reverence                   To send me mail, remove "_nospam" and
     the eternal.                all the vowels from my login name.


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

Date: Fri, 09 Jan 1998 20:34:25 -0600
From: "Dane S. Udenberg" <dsuden@netnet.net>
Subject: Need REDIRECT Help!!!
Message-Id: <34B6DE30.BCB2C45@netnet.net>

I have a domain which points to index.html in a directory on TABNET's
server.  I have a second domain which points to the same place,  but I
want it to bring up a different set of files...in essense, a different
"website".  Unfortunately, at present both bring up the same index.html
file.

TABNET told me I need a redirect file to point those arriving via the
second domain to the appropriate html file.   I don't want them to see
the other domain's index.html file at all.

How do I accomplish that?  Is there a standard CGI script floating out
there I could use?



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

Date: Sat, 10 Jan 1998 02:21:46 GMT
From: mwt@webstylists.com (Mark Thompson)
Subject: Parsing a log file with / /
Message-Id: <34b6d7ea.22059193@news.alt.net>

Hi,

I'm currently trying to edit a program called wwwstat to accect an
expanded log format and am having problems that I've narrowed down to
the following two lines of code.  Note that the second line of the log
file works exactly the way it was supposed to but the first line has
problems in the splitting of it.  It's working with perl 5.002.

My main problem is that I'm not sure exactly what "($host, $rfc931,
$authuser, $timestamp, $request, $status, $bytes) = /^(\S+) (\S+)
(\S+) \[(.+)\] \"(.+)\" (\S+) (\S+)\s/;" is actually doing.  

If anyone can tell me, please let me know.  

Thanks,

Mark Thompson


=========This is the code========
($host, $rfc931, $authuser, $timestamp, $request, $status, $bytes) =
        /^(\S+) (\S+) (\S+) \[(.+)\] \"(.+)\" (\S+) (\S+)\s/;
print(STDERR
"$host\n$rfc931\n$authuser\n$timestamp\n$request\n$status\n$bytes\n\n");

=======This is two lines of the log file, note that the only
difference between the two are that everything beyond the 297 ($bytes)
is truncated from the second========
tc3-la33.linkline.com - - [09/Jan/1998:17:06:22 -0800] "GET /
HTTP/1.0" 200 297 "-" "Mozilla/4.04 [en] (Win95; I)" GET / -
"HTTP/1.0"

tc3-la33.linkline.com - - [09/Jan/1998:17:06:22 -0800] "GET /
HTTP/1.0" 200 297 

=========This is the output.
tc3-la33.linkline.com
-
-
09/Jan/1998:17:06:22 -0800
GET / HTTP/1.0" 200 297 "-" "Mozilla/4.04 [en] (Win95; I)
GET
/

tc3-la33.linkline.com
-
-
09/Jan/1998:17:06:22 -0800
GET / HTTP/1.0
200
297


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

Date: Sat, 10 Jan 1998 03:18:20 GMT
From: mwt@webstylists.com (Mark Thompson)
Subject: Re: Parsing a log file with / /
Message-Id: <34b7e856.26263908@news.alt.net>

Never mind, I've found out from another source that the proper
expression to use was 
($host, $rfc931, $authuser, $timestamp, $request, $status, $bytes) =
    /^(\S+) (\S+) (\S+) \[([^\]]*)\] \"([^"]*)\" (\S+) (\S+)/;

On Sat, 10 Jan 1998 02:21:46 GMT, mwt@webstylists.com (Mark Thompson)
wrote:

>Hi,
>
>I'm currently trying to edit a program called wwwstat to accect an
>expanded log format and am having problems that I've narrowed down to
>the following two lines of code.  Note that the second line of the log
>file works exactly the way it was supposed to but the first line has
>problems in the splitting of it.  It's working with perl 5.002.
>
>My main problem is that I'm not sure exactly what "($host, $rfc931,
>$authuser, $timestamp, $request, $status, $bytes) = /^(\S+) (\S+)
>(\S+) \[(.+)\] \"(.+)\" (\S+) (\S+)\s/;" is actually doing.  
>
>If anyone can tell me, please let me know.  
>
>Thanks,
>
>Mark Thompson
>
>
>=========This is the code========
>($host, $rfc931, $authuser, $timestamp, $request, $status, $bytes) =
>        /^(\S+) (\S+) (\S+) \[(.+)\] \"(.+)\" (\S+) (\S+)\s/;
>print(STDERR
>"$host\n$rfc931\n$authuser\n$timestamp\n$request\n$status\n$bytes\n\n");
>
>=======This is two lines of the log file, note that the only
>difference between the two are that everything beyond the 297 ($bytes)
>is truncated from the second========
>tc3-la33.linkline.com - - [09/Jan/1998:17:06:22 -0800] "GET /
>HTTP/1.0" 200 297 "-" "Mozilla/4.04 [en] (Win95; I)" GET / -
>"HTTP/1.0"
>
>tc3-la33.linkline.com - - [09/Jan/1998:17:06:22 -0800] "GET /
>HTTP/1.0" 200 297 
>
>=========This is the output.
>tc3-la33.linkline.com
>-
>-
>09/Jan/1998:17:06:22 -0800
>GET / HTTP/1.0" 200 297 "-" "Mozilla/4.04 [en] (Win95; I)
>GET
>/
>
>tc3-la33.linkline.com
>-
>-
>09/Jan/1998:17:06:22 -0800
>GET / HTTP/1.0
>200
>297



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

Date: Fri, 09 Jan 1998 19:23:25 -0600
From: cbks@NOSPAM.magibox.net (Brock Sides)
Subject: Re: Pattern Matching
Message-Id: <cbks-0901981923250001@dave.magibox.net>

In article <eq1hMxPH9GA.270@upnetnews02.moswest.msn.net>, "Andie
Crossland" <AndieC@msn.com> wrote:

> I am trying to pattern match a string e.g.
> 
> "This is a \"perl\" script"
> 
> Is this possible to do it in one pattern match?
> I can only think of
> 
> m/"[^"]*"/
> 
> but this will only match
> "This is a \"

This will work:

m/"[^"\\]*(\\.[^"\\]*)*"/

(Credit Where It's Due Dept: this is from Jeffrey Friedl's wonderful book,
Mastering Regular Expressions, upon which too much praise cannot be
heaped.)

-- 
Brock Sides cbks@NOSPAM.magibox.net To reply, remove "NOSPAM."
http://www.magibox.net/~brock/
for(0..4){$humps="."x($_*2+1);$camel.="($humps)"}
"Jtsutona reP reh\nrekcah l"=~/$camel/s;
for(1..5){eval"print scalar reverse \"\$$_\""};


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

Date: 10 Jan 1998 00:46:41 GMT
From: tfletche@pcocd2.intel.com (Terry Michael Fletcher - PCD ~)
Subject: Re: Perl for Engineering purposes
Message-Id: <696gdh$ob2$1@news.fm.intel.com>

J. Bacon (jwbacon@ix.netcom.com) so eloquently and verbosely pontificated:
> Is anybody out there using Perl for 'engineering' purposes?  I just finished 
> up a script which communicates with GPIB instruments -- I intend to write most 
> all of my product test/calibration routines in Perl in the future (I am tired 
> of C compilers obsoleting themselves, and re-inventing the wheel).

perl is the scripting language of choice at INTeL.  we have script applications
such as simulation language compilers, VHDL processing, and stimulus vector
generation for chip models.  Perl is used for anything and everything.  there
are even scripts to pick destinations for lunchtime, or who brings donuts that
week.

at home, i am using perl to communicate with an HC11 processor EVBU board's
RS-232 serial port from WindowsNT (is this closer to your particular use?).  it
is used to remotely monitor and control a house via a web page.

i think that when you get down to those low-levels, the particular use of perl
becomes way too specific to be released as a public module.  it will probably be
difficult to find enough of us geeks using perl for the exact same thing to even
warrant a mailing list!

just my $.02

-- 
#!/usr/local/bin/perl -w
print   "J"                      ."u".        #    -- Terry Fletcher
        "s"    ."t".    " A",     "n"         # tfletche@pcocd2.intel.com
   .    "o"   ,""."".   "the",    "r ","P".   #  Views expressed....not
   "e"."rl"   ." Ha",   "c",''    .""  ."".   #  INTeL's....yadda yadda
      ""            ,   "k".      "e"  ."r"   #          yadda....



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

Date: 9 Jan 1998 16:49:15 -0800
From: mcravit@best.com (Matthew Cravit)
Subject: Re: Problem with Getopt::Std
Message-Id: <696gib$3ob$1@shell3.ba.best.com>

In article <34B6C16F.765B@btinternet.com>,
John Olsen  <jfo@btinternet.com> wrote:
>I may be reading this wrong but from the Getopt::Std documentation:

No, you're reading it correctly.

(relevant things cut with snippage between)

>use Getopt::Std ;
>getopts('h:lp:') ;
>
>and I type    myscript -h -l -p pathname filename
>
>Instead I get      opt_h = -l
>
>What am I missing? 

What you're missing is the effect of that colon after the -h switch.
The colon specifies that -h takes an argument, so the next thing after
the -h is assumed to be the argument to -h (and it gets assigned to
$opt_h) rather than another switch.

What you've given above is equivalent to something like

myscript -h someparameter

in which case the $opt_h gets assigned the value "someparameter". 

If you just want the -h option to act like a switch, rather than requiring
an argument, change your getopts call to read:

getopts('hlp:');

and then things should behave as you expect they would.

Hope this helps.
/MC

-- 
Matthew Cravit, N9VWG               | Experience is what allows you to
E-mail: mcravit@best.com (home)     | recognize a mistake the second
        mcravit@taos.com (work)     | time you make it.


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

Date: Sat, 10 Jan 1998 00:15:50 GMT
From: defike@spam.ilstu.edu.not (Don)
Subject: Recursing Directories in Search of Files, maybe?
Message-Id: <34b6bc4b.10857636@snews.zippo.com>

I wrote this little script to recurse directories in search of files
but when it gets to the call to the subroutine it never finishes the
rest of the @dirs_files from before the call.  It would appear that
their values are written over by each call to the subroutine.
I would appreciate any suggestions on how to approach this.
Thanks,
defike@ilstu.edu.spam.not 

$startdir = "f:\\main";
&Recurse ($startdir);
sub Recurse
 {
  local ($startdir) = @_;
  opendir DIR, $startdir;
  @dirs_files = sort grep !/^\.\.?$/, readdir DIR;
  foreach (@dirs_files)
  {
  $newdirfile = join "\\", $startdir, $_;
  if (-d $newdirfile)
   {
     print "DIR: $_ \n";
     &Recurse ($newdirfile);
   }
  else
   {
     print "FILE: $_\n";
   }
  }
}


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

Date: Fri, 09 Jan 1998 10:28:12 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: regex to escape {, } except in TeX commands
Message-Id: <34B6501C.512DD667@gpu.srv.ualberta.ca>

Michael Friendly wrote:
!
! In article <6911g2$dqv$1@sunburst.ccs.yorku.ca>
! friendly@hotspur.psych.yorku.ca (Michael Friendly) writes:
! |I need a regex to escape braces, {}, translating them to \{, \},
! |except when they are part of a TeX command like \texttt{stuff}.
! 
! Had several replies, but perhaps I didn't specify the problem clearly
! enough.
! I'd be willing to accept that the TeX commands would not be nested.
! What I actually want to do is to process code lines that may contain tex
! commends in comments:
! 
! table = { 1 2, 3 4};    /* see Figure~\ref{fig:one} */
! 
! to
! 
! table = \{ 1 2, 3 4\};  /* see Figure~\ref{fig:one} */
! 
! so, I want to avoid escaping { and } when it occurs in the
! pattern
!     \[a-zA-Z]+{[^}]+}
! 
! The { } in the code can actually extend over more than one line,
! 
! table = { 1 2,          /* see Figure~\ref{fig:one} */
!           3 4};
! 
! but I'd be willing to specify that the TeX commands cannot.
! 
! Does this make it easier?

either of the following seem to work on your example data:
---s///e method---
#!/usr/bin/perl -w
while (<DATA>) {   
    s/(\\\w+{[^}]*})|({|})/$1?$1:"\\$2"/ge;
    print;
}
__DATA__
table = { 1 2, 3 4};    /* see Figure~\ref{fig:one} */
table = { 1 2,          /* see Figure~\ref{fig:one} */
          3 4};

---poor man's look-behind---
#!/usr/bin/perl -w
while (<DATA>) {
    $_=reverse $_;
    s/(}|{)(?!(?:[^{]*{)?\w+\\)/$1\\/g;
    $_=reverse $_;
    print;
}
__DATA__
table = { 1 2, 3 4};    /* see Figure~\ref{fig:one} */
table = { 1 2,          /* see Figure~\ref{fig:one} */
          3 4};

possibly some further adjustment will be necessary given
further data...
hope it helps
regards
andrew


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

Date: Fri, 09 Jan 1998 20:13:26 -0500
From: Mark Hazen <mhazen@franklin.uga.edu>
To: the.tom@usa.net
Subject: Re: req: A) Perl/Tk B) Permanter Perl-Interpreter unter oSolaris
Message-Id: <34B6CB36.E7B6418D@franklin.uga.edu>

TheTom wrote:

> A) Wo kann ich Perl/Tk fuer Win311 und WinNT kriegen/saugen?

Guten Tag, Tom... Es tut mir leid; Ich kann nicht diesen Fragen auf
deutsch beantworten (mein Deutsche sind sehr schrecklich), so auf
englisch...

I'm not familiar with a Win3.11 version of Perl being in existence,but I
could be wrong. It's happened before, and it's even happened on this
newsgroup. As for Perl32 (Windows95/NT version), you can download it
from http://www.activestate.com/ which is a company that is developing a
Perl IDE called VisualPerl.

> B) Gibt es eine Moeglichkeit unter oSolaris (das is das SUN
> Unix OS) Perl als permanenten Prozess zu starten, soda_ der
> Overhead des Ladeprozesses beim Starten eines Perl-Scripts
> entfaellt? Hierbei bin ich an ALLEN Infos interessiert...

Okay.... there is no way I am aware of to do what you are trying to do
here (for all scripts on the system). But, if you are trying to do this
to speed up CGI response time on a web server, I highly recommend
looking into mod_perl and Apache; http://perl.apache.org has the
information you will need.

Hope someone else has more information about this,

Tschao,

-mh.
----
   . _+m"m+_"+_   Mark Hazen    Network Administrator, Dean's Office
 d' Jp     qh qh             The Franklin College of Arts & Sciences
Jp  O       O  O             The University of Georgia (706)542-1546
Yb  Yb     dY dY
 O   "Y5m2Y"  "     even the mightiest wave starts out as a ripple.
  "Y_           why make waves when it's easier to nurture ripples?




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

Date: Fri, 09 Jan 1998 09:58:55 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Simple string length
Message-Id: <34B6493F.336E1885@gpu.srv.ualberta.ca>

John Porter wrote:
> 
> Martien Verbruggen wrote:
> >
> >     $cnt = $string =~ tr/0-9//; # count the digits in $string
> 
> Ok, but why destroy the string?  Replace each digit with itself:
> 
>       $cnt = $string =~ tr/0-9/0-9/;

tr/0-9// destroys the string? did you try it?
did you check the perlop manpage...

    If the /d modifier is used, the REPLACEMENTLIST is
    always interpreted exactly as specified.
    Otherwise, if the REPLACEMENTLIST is shorter than
    the SEARCHLIST, the final character is replicated
    till it is long enough.  If the REPLACEMENTLIST is
    null, the SEARCHLIST is replicated.  This latter
    is useful for counting characters in a class or
    for squashing character sequences in a class.


$string="555-555-5555";
$count=$string=~tr/0-9//;
print "$string : $count\n";

which prints: 555-555-5555 : 10

regards
andrew


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

Date: Fri, 09 Jan 1998 20:02:41 -0500
From: schinder@leprss.gsfc.nasa.gov (Paul J. Schinder)
Subject: Re: UNIX commands via FTP on a MACINTOSH -- HAY-ELP!
Message-Id: <schinder-0901982002420001@schinder.clark.net>

In article <comdog-ya02408000R0901981547540001@news.panix.com>,
comdog@computerdog.com (brian d foy) wrote:

}  In article <mbudash-0901981229400001@d162.pm12.sonic.net>,
mbudash@sonic.net (Michael Budash) posted:
}  
}  >10 points to brian for the closest answer. actually, the correct answer is
}  >the "Set Permissions..." command
}  >in the Remote menu.
}  
}  umm, that seems to be what i said in 
}  
}     Subject:      Re: UNIX commands via FTP on a MACINTOSH -- HAY-ELP!
}     From:         comdog@computerdog.com (brian d foy)
}     Date:         1998/01/06
}     Message-ID:   <comdog-ya02408000R0601981807110001@news.panix.com>
}  
}  do i get any more points for having not only the closest answer,
}  but the correct one as well (if you were referring to Fetch 3, you 
}  misnamed the Menu selection).
}  
}  but just as an aside, has anyone done anything with MacPerl and
}  scripting AppleScriptable thingys?

Many people, (check out Chris Nandor's CPAN directory, for example), but
in this case, why would you bother?  Net::FTP has a quot() method that can
send arbitrary commands, and a supported() method that can ask a remote
server whether it understands a given command.  It comes with recent
versions of MacPerl, and it works.

It never pays to use AppleScript when you can avoid it.

}

-- 
Paul J. Schinder
NASA Goddard Space Flight Center
Code 693, Greenbelt, MD 20771
schinder@leprss.gsfc.nasa.gov


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

Date: Fri, 09 Jan 1998 22:49:44 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: UNIX commands via FTP on a MACINTOSH -- HAY-ELP!
Message-Id: <comdog-0901982249440001@news.panix.com>
Keywords: just another new york perl hacker

In article <comdog-ya02408000R0901981547540001@news.panix.com>, comdog@computerdog.com (brian d foy) posted:

> In article <mbudash-0901981229400001@d162.pm12.sonic.net>, mbudash@sonic.net (Michael Budash) posted:
> 
> >10 points to brian for the closest answer. actually, the correct answer is
> >the "Set Permissions..." command
> >in the Remote menu.

> do i get any more points for having not only the closest answer,
> but the correct one as well (if you were referring to Fetch 3, you 
> misnamed the Menu selection).

Michael's right as well - his menu selection happens to be directly 
above the one of which i spoke.  sorry for the confusion...

-- 
brian d foy                                 <http://computerdog.com>


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

Date: 10 Jan 1998 00:41:22 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: weird problem!
Message-Id: <696g3i$kra$1@marina.cinenet.net>

Ricky (ric@megsinet.net) wrote:
: this is weird.  sometimes, my scripts don't work when they absolutely
: should.  does anyone know why this happens?  i mean an extremely simple,
: child's play script won't work like this one:
: 
: #!usr/local/bin/perl

Should be: #!/usr/local/bin/perl -w

Note initial / before usr and the -w switch.  You should massage your 
script until no messages are generated by -w.  "use strict;" is another 
useful tool in this regard.  The price in front-end pickiness is more 
than repaid in saved debugging time.

: print <<end

Should be: print <<end;

In the absence of the ; this triggers a compilation-time error down 
between the here-doc 'end' and the following 'exit(0);', as a terminating 
; was never seen on the previous statement.

: Content-type: text/plain
: 
: Hello World!
: end
: exit(0);

If you're running this from a CGI (as seems likely from your post), I 
have little doubt that it's erroring out on the missing ; without 
generating enough diagnostic output to clue you in.  Did you even try to 
run this thing locally, from a command line, before putting it on the 
server?  Doing so will save you from endless misery, believe me.

: yet, this script on the same server in the same directory works.
[script snipped]

Yeah, because it has no syntax errors. :)

: does anyone know why this happens.  i can't tell you how frustrating it
: is to look for a bug when none exists.  please help. . . anyone?

If the thing isn't running, odds are really good a bug exists. :)

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Sat, 10 Jan 1998 03:31:25 GMT
From: zilbauer@BADSPAMeuropa.com (Robert Zilbauer)
Subject: Re: weird problem!
Message-Id: <696q2d$3lg_002@stingray.europa.com>

In article <34B6B39D.FB353F52@megsinet.net>, Ricky <ric@megsinet.net> wrote:
>this is weird.  sometimes, my scripts don't work when they absolutely
>should.  does anyone know why this happens?  i mean an extremely simple,
>child's play script won't work like this one:
>
>#!usr/local/bin/perl
>
>print <<end
>Content-type: text/plain
>
>Hello World!
>end
>exit(0);

Could be that you're missing a forward slash in the path to the perl 
executable:  #!/usr/local/bin/perl


-----
Robert C. Zilbauer, Jr.         
CIO, Europa Communications, Inc.
 
          "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn."



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

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

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