[7392] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1017 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 12 15:17:18 1997

Date: Fri, 12 Sep 97 12:01:16 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 12 Sep 1997     Volume: 8 Number: 1017

Today's topics:
     $$$ Need programmer to write script! <webmaster@cnvi.com>
     Re: $$$ Need programmer to write script! <rbush@up.net>
     Re: Add elements to %hash (Jan Gruber)
     ARSPerl run problems <jwilliam@buzz.dope.com>
     Re: backreferences and /i in regex <ajohnson@gpu.srv.ualberta.ca>
     Client-server example in Perl5 on NT4 SP3? <gilbert@dcbc.com>
     Comparing dates?? (Burt Lewis)
     Re: Compiling scripts <bteague@aol.net>
     Re: Detecting NFS outage while <> <jay@rgrs.com>
     Forking problem (Peter Scott)
     How to make 'beep' sound in perl? <kxliu@us.oracle.com>
     Howto Parse data in spaced columns??? <nospam.gibsonc@aztec.asu.edu>
     Re: Howto Parse data in spaced columns??? <rbush@up.net>
     is it possible to rename multiple files? <dtrobert@ladc.lockheed.com>
     Re: is there a better way to do this subroutine? (Terry Michael Fletcher - PCD ~)
     PDF documentation for Perl: where? (Bernard M. Piller)
     Re: perl script works differently on solaris and linux (Andrew D. Arenson)
     Re: pipe in the mailer <psrc@corp.airmedia.com>
     Reading in list question <jjune@midway.uchicago.edu>
     Re: Reading in list question <rbush@up.net>
     Re: Reading in list question <yinso@u.washington.edu>
     Re: script to change htpasswd (Jan Gruber)
     Sockets under Perl 5.003 and Solaris 2.5.1 (Clarence Wilkerson)
     Re: trying to execute NET USER command within script... (Gerben Vos)
     Using Perl to access pages for Java applet <paulh@irsoft.demon.co.uk>
     Re: Why don't my <<HERE documents work? (Faust Gertz)
     Re: win32 - piping from a command <ron@mrrrossbayeng.com>
     Writing format to string <br2a+@andrew.cmu.edu>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 12 Sep 1997 18:01:11 GMT
From: "Joel L" <webmaster@cnvi.com>
Subject: $$$ Need programmer to write script!
Message-Id: <01bcbfa5$cbdd0560$48c545cf@rosedale>

$$$ Need programmer to write script!

Good Day,

We are looking for a perl programmer who can produce a program using Perl
CGI script that would be much like the public domain 'free-for-all-links
page' script with additional functionality.

We are seeking a programmer on a subcontractor basis to write this
Automated Links Page script with the following wish list of functions:

We need an option where the client fills out the info but the link doesn't
become "active" on our links page until we say it's ok (we want to make
sure
they post our banner prior to their link going online).  We would like to
be
able to access their submission from an admin page and decide if their link
is ok or if it should be trashed.

We would like an additional field for their links page URL - where they
placed our code (our banner) so that we can check this quickly from the
admin
function.  If they have placed our banner on their site to our liking, then
we
can approve their link immediately from the admin function thus keeping us
from having to retype their link into our links page.

We would like to be notified via email anytime someone submits a link to
the
site for approval.

We would like the program to be able to automatically rid of duplicate
URL's.  If someone attempts to spam, we would like the program to make a
record of this and notify us via email.

We will need multiple categories and the option of being able to add
additional categories in the future.  We would like this control from the
admin function as well.

We would like the client to have a preview page so that they can make
changes to their submission before finalizing the submission.

We would like the client to be able to edit their link by using an edit
function only accessable via a password they provide when the original link
is posted.

If they forget password, we would like this program to be able to email
their password to their email address.

We would like a 'black list' file that is checked to see if there is a URL
there that we don't want on the page.  This could help us to block known
spammers.  We would like the admin function to notify us via email of
potential duplicates / spammers and ask us if we want to add their URL to
the black list. 

There needs to be some provision to protect against file locking so that
the system doesn't crash when two people try to submit at the same time.

We would like the option of the system to send an email to the person that
just submitted their link to the page.

We would like the links to rotate so that every day, the links are
displayed
alphabetically, but starting with the next letter in the alphabet (to even
the playing field and reduce spamming the letter A).  We would like to
control this through the admin function.

Finally, you need to know that the program will run on a website that is
hosted by Mindspring Enterprises.  Mindspring gives full access to cgi-bin
for custom apps with additional support, etc..

Basically, we're looking for a heckava lot more control over the current
public domain free-for-all script.  A super-turbo links page if you will!

We are prepared to pay you for such a script.  We need this in 7 - 14 days.

Please reply with:

List of references / sites you have programmed for.
Total price to write scripts and complete program (We respectfully aren't
interested in paying you an hourly fee.  You will get paid one flat to
complete the job.  How long it takes you depends on your level of expertise
and experience.)
Total price per hour to make changes in the future.
Time needed to complete this job.
Questions you might have.

Kindest Regards,
Joel L
webmaster@cnvi.com










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

Date: Fri, 12 Sep 1997 14:34:33 -0400
From: "Raymond K. Bush" <rbush@up.net>
Subject: Re: $$$ Need programmer to write script!
Message-Id: <34198B39.5FD0@up.net>

I have a similiar application on my todo list.  If there is somone out
there who would like to collaborate on such a project (I WOULD REQUIRE
PUBLIC DOMAIN DISTRIBUTION ie freeware ... if i were to work on the
project, but i am doing that already ...) contact me.

Joel L wrote:
> 
> $$$ Need programmer to write script!
> 
> Good Day,
> 
> We are looking for a perl programmer who can produce a program using Perl
> CGI script that would be much like the public domain 'free-for-all-links
> page' script with additional functionality.
> 
> We are seeking a programmer on a subcontractor basis to write this
> Automated Links Page script with the following wish list of functions:
> 
> We need an option where the client fills out the info but the link doesn't
> become "active" on our links page until we say it's ok (we want to make
> sure
> they post our banner prior to their link going online).  We would like to
> be
> able to access their submission from an admin page and decide if their link
> is ok or if it should be trashed.
> 
> We would like an additional field for their links page URL - where they
> placed our code (our banner) so that we can check this quickly from the
> admin
> function.  If they have placed our banner on their site to our liking, then
> we
> can approve their link immediately from the admin function thus keeping us
> from having to retype their link into our links page.
> 
> We would like to be notified via email anytime someone submits a link to
> the
> site for approval.
> 
> We would like the program to be able to automatically rid of duplicate
> URL's.  If someone attempts to spam, we would like the program to make a
> record of this and notify us via email.
> 
> We will need multiple categories and the option of being able to add
> additional categories in the future.  We would like this control from the
> admin function as well.
> 
> We would like the client to have a preview page so that they can make
> changes to their submission before finalizing the submission.
> 
> We would like the client to be able to edit their link by using an edit
> function only accessable via a password they provide when the original link
> is posted.
> 
> If they forget password, we would like this program to be able to email
> their password to their email address.
> 
> We would like a 'black list' file that is checked to see if there is a URL
> there that we don't want on the page.  This could help us to block known
> spammers.  We would like the admin function to notify us via email of
> potential duplicates / spammers and ask us if we want to add their URL to
> the black list.
> 
> There needs to be some provision to protect against file locking so that
> the system doesn't crash when two people try to submit at the same time.
> 
> We would like the option of the system to send an email to the person that
> just submitted their link to the page.
> 
> We would like the links to rotate so that every day, the links are
> displayed
> alphabetically, but starting with the next letter in the alphabet (to even
> the playing field and reduce spamming the letter A).  We would like to
> control this through the admin function.
> 
> Finally, you need to know that the program will run on a website that is
> hosted by Mindspring Enterprises.  Mindspring gives full access to cgi-bin
> for custom apps with additional support, etc..
> 
> Basically, we're looking for a heckava lot more control over the current
> public domain free-for-all script.  A super-turbo links page if you will!
> 
> We are prepared to pay you for such a script.  We need this in 7 - 14 days.
> 
> Please reply with:
> 
> List of references / sites you have programmed for.
> Total price to write scripts and complete program (We respectfully aren't
> interested in paying you an hourly fee.  You will get paid one flat to
> complete the job.  How long it takes you depends on your level of expertise
> and experience.)
> Total price per hour to make changes in the future.
> Time needed to complete this job.
> Questions you might have.
> 
> Kindest Regards,
> Joel L
> webmaster@cnvi.com


--Ray
 .70~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~07.
      --- reply to rbush - at - up - dot - net ---
--- please include indication of past correspondence ---
      --- in order to receive a faster response ---


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

Date: Fri, 12 Sep 1997 15:09:32 GMT
From: jgr@tpnet.de (Jan Gruber)
Subject: Re: Add elements to %hash
Message-Id: <34195b06.405850@eunetnews.germany.eu.net>

Hi all !

Thx to all, i have solved my prob now.


Bye
JAn


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

Date: Fri, 12 Sep 1997 10:12:43 -0600
From: Jeff Williams <jwilliam@buzz.dope.com>
Subject: ARSPerl run problems
Message-Id: <874076418.6355@dejanews.com>

Hello,

        I have used perl for simple scripts for quite some time but
this
is my first atempt at using a external module.  I need access to
Remedy ARS databases within some scripts and have compiled the ARSperl
module but some errors when I try to use them.

My System
---------
CPU:            Sparc 20
OS:             Solaris 2.4
Compiler:       GCC 2.7.2.1
Perl:           Perl 5.003 (compiled from source not installed from
the
Solaris package found at sunsite)


ARSPerl
-------

All seemed to compile and install fine but when I run an example I get
the following.

ctiemc 11: List NTServers.pl
Can't load
'/opt2/gnu/lib/perl5/site_perl/sun4-solaris/auto/ARS/ARS.so'
for module ARS: ld.so.1: /usr/local/bin/perl: fatal: relocation error:
symbol not found: GetNTPasswordSeed: referenced in
/opt2/gnu/lib/perl5/site_perl/sun4-solaris/auto/ARS/ARS.so at
/opt2/gnu/lib/perl5/DynaLoader.pm line 140.

 at /opt2/gnu/lib/perl5/site_perl/ARS.pm line 70
BEGIN failed--compilation aborted at .//ListNTServers.pl line 14.
Can't locate auto/ARS/__ars_Termi.al in @INC at
/opt2/gnu/lib/perl5/site_perl/ARS.pm line 209
END failed--cleanup aborted at .//ListNTServers.pl line 14.
root @ ctiemc 12:


Help Please?  Can someone enlighten me as to what I did wrong.

                                        Thanks In Advance, Jeff

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Fri, 12 Sep 1997 10:01:42 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: backreferences and /i in regex
Message-Id: <34195956.3B5722EE@gpu.srv.ualberta.ca>

Tom Grydeland wrote:
> 
> On 11 Sep 1997 19:14:37 GMT,
> Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
> 
> > >                          Interesting.  Will the same apply to
> > > ((?m)re), ((?s)re) etc?
> >
> > I would not be sure until the test suite contains a test.  Care to
> > contribute a couple?  Looks like "a simple one" t/op/regexp.t cannot
> 
> I don't have the jumbo patch installed, so I can't try these out for
> myself, but I imagine something like
> 
> "a\nb\n" =~ /a(?s(.))b(?!.)/
>
> should match iff (?s ) is applied to only the first .

the s modifier needs to be wrapped by itself, grouping
is then done around that, the following does indeed match
with the jumbo-re on 5.00403

print "matched\n" if "a\nb\n" =~ /a((?s)(.))b(?!.)/;

> "a\nb\n" =~ /(?m(^b))(?!$)/
> 
> should match iff (?m ) applies only to the ^ and not to the $.

similar remark about (?m) being isolated...but this one
doesn't appear to work correctly, even just:

print "Matched\n" if "a\nb\nc\n" =~ /((?m)(^b))/;

won't garner a match. although things seems a tad 
odd because:

print "Matched\n" if "a\nb\nc\n" =~ /^b/;
doesn't match (as expected), but:

print "Matched\n" if "a\nb\nc\n" =~ /()^b/;
does match...hmm?

regards
andrew


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

Date: Fri, 12 Sep 1997 13:43:26 -0500
From: Gilbert Hu <gilbert@dcbc.com>
Subject: Client-server example in Perl5 on NT4 SP3?
Message-Id: <34198D4D.4E7E6A8E@dcbc.com>

Does anyone have the camel book client-server example for NT?
I tried the (UNIX) example, and "fork" is not supported.  I'm trying to
write a simple
client piece to submit two lines to port 25.  The socket, bind,
connect portions all worked.  However, without the fork, I can
either do the read only or the write only but not both.  Any
work-arounds?

Regards,
Gilbert



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

Date: 12 Sep 1997 18:34:06 GMT
From: burt@ici.net (Burt Lewis)
Subject: Comparing dates??
Message-Id: <5vc1uu$q5f$1@bashir.ici.net>


Hi,

I hope this is simple.

I'm capturing birth dates via a form, something like:

09101981 (mmddyyyy)

I need to determine if the age of this person is greater than 18.

Anyone have any routines or ideas on the best and easisest way to do this?

Thanks!

Burt Lewis
burt@ici.net



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

Date: Fri, 12 Sep 1997 11:31:46 -0400
From: Bryan Teague <bteague@aol.net>
Subject: Re: Compiling scripts
Message-Id: <34196062.9CECD65C@aol.net>

Aaron wrote:
> 
> I'm actually interested in this as well
> 
> along with what a 'dump compiled' script is
> 
> I've heard of such a beast, but don't know where to look for information
> 

In the manpage on perl flags, it shows the following: 

         -u   causes perl to dump core after compiling your script.
               You can then take this core dump and turn it into an
               executable file by using the undump program (not
               supplied).  This speeds startup at the expense of some
               disk space (which you can minimize by stripping the
               executable).  (Still, a "hello world" executable comes
               out to about 200K on my machine.)  If you are going to
               run your executable as a set-id program then you should
               probably compile it using taintperl rather than normal
               perl.  If you want to execute a portion of your script
               before dumping, use the dump operator instead.  Note:
               availability of undump is platform specific and may not
               be available for a specific port of perl.

Basicly, causing perl to core dump after the script is compiled. Then
using the resultant core file and undump to create an executable.  
I, personally, have never tried it though.  

Bryan 
-- 
Bryan Teague		bteague@aol.net		Phone: 703-453-4397


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

Date: 12 Sep 1997 12:03:19 -0400
From: Jay Rogers <jay@rgrs.com>
To: bks@netcom.com (Bradley K. Sherman)
Subject: Re: Detecting NFS outage while <>
Message-Id: <82wwkm4j08.fsf@shell2.shore.net>

bks@netcom.com (Bradley K. Sherman) writes:
> If I am reading a file from an NFS mounted disk and
> the plug is pulled on the remote machine, can I tell
> the difference between this error condition and EOF?

You can't really distinguish this.  A solution you might try is to
establish a timeout while reading.  To do that, you'll have to use the
low level sysread() and select() to do non-blocking I/O.

--
Jay Rogers
jay@rgrs.com


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

Date: 12 Sep 1997 18:14:13 GMT
From: pjscott-remove-to-email@euclid.jpl.nasa.gov (Peter Scott)
Subject: Forking problem
Message-Id: <5vc0pl$8fe@netline.jpl.nasa.gov>

This is bizarre.  I have a program which forks children that appear to 
be executing *after* they have exited and signalled the parent!

The following code forks six subprocesses, each of which creates an empty
file in /tmp called "test" plus the child's pid.  It then waits for each
child to finish, and deletes the corresponding file.

$| = 1;
foreach (1..6) {
  if ($pid = fork) {
    $p{$pid} = 1;               # parent
    print "Spawn $pid\n";
  }
  else {
    exit &bar;			# child
  }
}
while (keys %p) {
  $pid = wait until exists $p{$pid};
  print "Harvest $pid: ";
  print "can't find its file!!!" unless -e "/tmp/test$pid";
  print "\n";
  unlink "/tmp/test$pid";
  delete $p{$pid};
}

sub bar {
  open (F, ">/tmp/test$$");
  close F;  
  return 0;
}

The result:

Spawn 1771
Spawn 1772
Spawn 1773
Spawn 1774
Spawn 1775
Spawn 1776
Harvest 1776: can't find its file!!!
Harvest 1773: 
Harvest 1772: 
Harvest 1771: 
Harvest 1775: 
Harvest 1774: 

Yet /tmp/test1776 exists!  Here's what I've been able to find out:

I need to create 6 or more children to see this effect, although it
doesn't always happen with 6, so if you don't see this happen, increase
the count to 8 or 10.

If I change the $pid = wait until line to:
  do
  {
    $pid = wait;
  } until exists $p{$pid};

there is no problem.

If I truss the parent, I still get the behavior.  If I truss the children
as well, I don't (so much for debugging).

A test after the close in bar() for the existence of the file never fails.

The file not found is always the one from the last forked child in this
program.  However, in the more complicated program where I first saw this
behavior, I have seen it happen to multiple children.

Perl 5.004_01 on Solaris 2.5.1.  Not running on a multiprocessor machine.
/tmp is local, not NFS mounted.

-- 
This is news.  This is your      |  Peter Scott, NASA/JPL/Caltech
brain on news.  Any questions?   |  (Peter.J.Scott at jpl.nasa.gov)

(Sorry for forcing email respondents to edit the To: header, but the
spam is just too bad otherwise.)

Disclaimer:  These comments are the personal opinions of the author, and 
have not been adopted, authorized, ratified, or approved by JPL.


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

Date: 12 Sep 1997 11:26:19 -0700
From: Kun Liu <kxliu@us.oracle.com>
Subject: How to make 'beep' sound in perl?
Message-Id: <h9rk9gmpewk.fsf@ap311sun.us.oracle.com>

How do I make 'beep' sound in perl?  Much like if you do

	echo '\07' in sh or ksh.

But I want this to be independent of the shell from which I invoke this script.

Regards,

K. Liu


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

Date: Fri, 12 Sep 1997 08:43:02 -0700
From: Gip <nospam.gibsonc@aztec.asu.edu>
Subject: Howto Parse data in spaced columns???
Message-Id: <34196306.C8CE508B@aztec.asu.edu>


--------------74B844D8CA773035A9C8AC7C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

How do I parse data out of the following computed text file, you can
assume no tabs, just plain old spaces:


column 1         column 2               column 3                column 4

aaa                  bbb                       ccc
ddd
eee                                                     fff

I want to be able to know that fff is in column 4, and that ccc is in
column 3.

Thanks for your time,
CG

--------------74B844D8CA773035A9C8AC7C
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
<FONT SIZE=-1></FONT>

<P><FONT SIZE=-1>How do I parse data out of the following computed text
file, you can assume no tabs, just plain old spaces:</FONT>
<BR><FONT SIZE=-1></FONT>&nbsp;<FONT SIZE=-1></FONT>

<P><FONT SIZE=-1>column 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
column 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
column 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
column 4</FONT><FONT SIZE=-1></FONT>

<P><FONT SIZE=-1>aaa&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
bbb&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ccc</FONT>
<BR><FONT SIZE=-1>ddd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
eee&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
fff</FONT><FONT SIZE=-1></FONT>

<P><FONT SIZE=-1>I want to be able to know that fff is in column 4, and
that ccc is in column 3.</FONT><FONT SIZE=-1></FONT>

<P><FONT SIZE=-1>Thanks for your time,</FONT>
<BR><FONT SIZE=-1>CG</FONT></HTML>

--------------74B844D8CA773035A9C8AC7C--



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

Date: Fri, 12 Sep 1997 12:53:52 -0400
From: "Raymond K. Bush" <rbush@up.net>
Subject: Re: Howto Parse data in spaced columns???
Message-Id: <341973A0.4345@up.net>

Gip wrote:
> 
> How do I parse data out of the following computed text file, you can
> assume no tabs, just plain old spaces:
> 
> 
> column 1         column 2               column 3                column
> 4
> 
> aaa                  bbb                       ccc
> ddd
> eee                                                     fff
> 
an off the top of my head inneficient way (in a pinch) might be (i'm
open to suggestion myself):

open(file,"cat filename|cut -c$range1|");
while(defined($=<file>){
#check for item
}
open(file,"cat filename|cut -c$range2|");
while(defined($=<file>){
#check for item
}
open(file,"cat filename|cut -c$range3|");
while(defined($=<file>){
#check for item
}
open(file,"cat filename|cut -c$range4|");
while(defined($=<file>){
#check for item
}

> I want to be able to know that fff is in column 4, and that ccc is in
> column 3.
> 
> Thanks for your time,
> CG

--Ray
 .70~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~07.
      --- reply to rbush - at - up - dot - net ---
--- please include indication of past correspondence ---
      --- in order to receive a faster response ---

--Ray
 .70~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~07.
      --- reply to rbush - at - up - dot - net ---
--- please include indication of past correspondence ---
      --- in order to receive a faster response ---


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

Date: Fri, 12 Sep 1997 08:10:19 -0700
From: David Roberts <dtrobert@ladc.lockheed.com>
Subject: is it possible to rename multiple files?
Message-Id: <34195B5B.167E@ladc.lockheed.com>

i've looked through Oreilly's book and it shows how to do a mulitple
rename on files.

say, for example, that i wanted to strip off the .bak from a bunch of
files, it says:

rename 's/\.bak$//' *.bak

i tried calling this at the command prompt with 

/usr/bin/perl -e 'rename 's/\.bak$//' *.bak'

but got error:
Illegal variable name

i also tried it without the outer quotes and got:
/usr/bin/perl: No Match  (it is there, i checked)


i have both perl 4.0 and 5.002 and tried it with both.
any ideas?

thanks
-- 
| David Roberts (AKA "aeroman") || ...One tactical thermonuclear    |
| dtrobert@ladc.lockheed.com    || weapon can ruin your whole day:) |
| work  (805)572-5778           || (send complaints to "/dev/null") |
=====================================================================


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

Date: 12 Sep 1997 16:50:10 GMT
From: tfletche@pcocd2.intel.com (Terry Michael Fletcher - PCD ~)
Subject: Re: is there a better way to do this subroutine?
Message-Id: <5vbrs2$q3h$1@news.fm.intel.com>

Raymond K. Bush (rbush@up.net) so eloquently and verbosely pontificated:
> I'd like the following subroutine to be more efficient ... any ideas?

yes, tell us what it is you want to do!
there are a bunch of things that immediately look WRONG, and i have no
idea what your algorithm is, or what you are passing to this sub.  let me
see if i can help:

> sub SPL{
>         local(*p,*plog)=@_; 
                ^^^^^^^^
first things is to upgrade to perl5, because people wont normally support
perl4 here.  then you wouldnt need to use those ugly globs.

>         #@nplog=@plog;  
>         #print @p;
>         #print @plog;

i assume your data was passing properly, since you debugged it with print
statements here.

>         foreach $user(@p){
>                 $report="";
>                 ($u,@junk)=split(/\:/, $user);
                     ^^^^^^
dont waste an entire array!  give split a maximum of 1.  and lose the "\"
since a colon is not special in a regular expression.

                  ($u) = split (/:/, $user, 1);

>                 #print "$u\n";
>                 #@plog=@nplog;
                   ^^^^^^^^^^^^
what was this attempting to debug?  didnt you just assign the inverse
above earlier?  strange...

>                 foreach $ple(@plog){
>                         if ($ple =~ " $u "){

whoops!  not sure if you are really trying to match the $u with a space
character on each side, but i think you want:
                          if ($ple eq $u)
im sure that the above if statement never even matched?

> #                               print ",$ple,\n";
> # 
> #example line:  Sep 3 15:44:08 dd43 popper[24571]: Stats: mick 0 0 0 0
> # 
>                                 if ($report ne ""){
>                                         $report="$report|$ple";
                                          ^^^^^^^^^^^^^^^^^^^^^^
                                          $report .= "|$ple";
>                                 }else{ 
>                                         $report="$ple";
>                                 } 
>                         } 
>                         #else{ 
>                         #       push(@nplog);
>                         #} 
>                 } 

indent these lines from HERE:
>         if ($report eq ""){ 
>                 $report="$u nmct"; 
>         } 
>         #print ",$report,\n"; 
>         push (@report,$report); 
to HERE to make it less confusing.

>         } 
>         return(@report); 
> }

well, not sure if i wasted my time or not, but maybe that helps.

-- 
#!/usr/local/bin/perl -- tfletche@pcocd2.intel.com
map{$;.=chr$_}(112,114,105,110,116,32,117,110,112,97,99,107,32,34,117,
34);$_=$;.=q>,':2G5S="!A;F]T:&5R(%!E<FP@:&%C:V5R+`H`'>;y;\034;;d;eval;



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

Date: Fri, 12 Sep 1997 18:58:11 +0200
From: piller@netway.at_NOSPAM (Bernard M. Piller)
Subject: PDF documentation for Perl: where?
Message-Id: <19970912185811565848@[192.168.1.2]>

Hi,
I am looking for the PDF Documentation for Perl 5.003.
All the mirrors point to a 5.004BETA file that doesn't exist. Doese
anybody know where I can find the 5.003 version?

Bernard

-- 
* bmp System Support               Vienna, Austria *
* http://www.rrr.net/hoss       Power is Macintosh *
* remove "_NOSPAM" from e-mail address for replies *



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

Date: 12 Sep 1997 13:36:03 -0500
From: arenson@hen.imgen.bcm.tmc.edu (Andrew D. Arenson)
Subject: Re: perl script works differently on solaris and linux
Message-Id: <wqoh5yfkh8.fsf@hen.imgen.bcm.tmc.edu>

Karsten Kreher <lo1be.kkrehe01@eds.com> writes:

> 
> I have a perl script that produces different output on Solaris and
> Linux...
> I'm clueless on how to find the error/difference.
> These's no system interaction but reading a text file and manipulating
> it.
> The output on the Linux machine seems to be "correct", since it is the
> same
> that the original bourne shell script gives. When I try to execute 
> 
> Maybe somebody has a suggestion?!

I don't know if you'll like this suggestion, but you need to figure
out exactly where the two scripts are differing. One way to do
this is to step through them with a debugger. Another is to insert
print lines. Another is to start removing code from both until
you isolate where the differences occur. 
-- 
Andrew D. Arenson            | http://gc.bcm.tmc.edu:8088/cgi-bin/andy/andy
Baylor College of Medicine   | arenson@bcm.tmc.edu        (713)  H 520-7392
Genome Sequencing Center, Molecular & Human Genetics Dept.     | W 798-4689
One Baylor Plaza, Room S903, Houston, TX 77030                 | F 798-5386


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

Date: Fri, 12 Sep 1997 12:34:12 -0400
From: Paul S R Chisholm <psrc@corp.airmedia.com>
To: Sascha Kerschhofer <e9127005@stud1.tuwien.ac.at>
Subject: Re: pipe in the mailer
Message-Id: <34196F04.7B1D@corp.airmedia.com>


Sascha Kerschhofer wrote:
> i can mail messages with the mailer by opening a filehandle.
> open (MAIL, "|usr/bin/mail asd@akjsd.net");
> then i am mailing the text with the print command. i print:

> From: myadress
> Subject: my sybject
> And here i am mailin the message

> but: how can i divide the header (subject, from..) from the message
> itself? if i do it in the way i showed, alle the message remains in the
> Subject when reading the mail ...

Several people suggested putting a blank line between header and body:

    From: myaddress
    Subject: my subject

    And here I am mailing the message

Note this only works with a very low level mailer (e.g., sendmail). In a
higher level mailer (e.g., mailx, Mail, and /usr/bin/mail on many
systems, let alone Elm or Pine or such), all lines will be treated as
body lines unless they begin with some magic escape character (often but
not always "~"). You could try:

    ~s my subject
    And here I am mailing the message

or

    open (MAIL, "|usr/bin/mail -s 'my subject' asd@akjsd.net");

but then if someone has a line like:

    ~!rm -rf /

in the body of the message, you could be in serious trouble.

Which is why this is a FAQ:

http://language.perl.com/CPAN/doc/manual/html/pod/perlfaq9/How_do_I_send_read_mail_.html

How do I send/read mail? 

Sending mail: the Mail::Mailer module from CPAN (part of the MailTools
package) is UNIX-centric, while Mail::Internet uses Net::SMTP
which is not UNIX-centric. Reading mail: use the Mail::Folder module
from CPAN (part of the MailFolder package) or the Mail::Internet
module from CPAN (also part of the MailTools package).
--
Paul S. R. Chisholm, AirMedia, Inc.     (formerly Ex Machina)
mailto:psrc@corp.airmedia.com  http://corp.airmedia.com/~psrc
 I'm not speaking for the company, I'm just speaking my mind


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

Date: Fri, 12 Sep 1997 15:31:34 GMT
From: Joseph June <jjune@midway.uchicago.edu>
Subject: Reading in list question
Message-Id: <Pine.GSO.3.95.970912102111.17749A-100000@harper.uchicago.edu>

Hello,

I am a struggling perl newbie and have a problem which I have been
struggling for a while now... 

I have a data file... three columns separated by tabs... like

198267	19823	3287123
12389	3891	4789
2913	3819	2891

and so on... currently I have a script that will read and split these guys
into an array... for some other use... however... i now have to make an
addition... so that file includes some more stuff... so my data file looks
like

Joseph
Charlie
Al

198267  19823   3287123
12389   3891    4789
2913    3819    2891


so i now have to read in the data on the top before reading in the 3
column data... now... i think i can do this of i put a marker... like ###
or something between the name... like 

#####
Joseph
Charlie
Al
#####
  
198267  19823   3287123
12389   3891    4789   
2913    3819    2891   

but would like a cleaner way to do so... if anyone has any advice... it
would be greatly appreciated!

Thank you so much for your help in advance... 

Joseph June
The University of Chicago
Anesthesia and Critical Care
Phone: 773-834-1450 or 773-834-0885
Fax: 773-702-1182




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

Date: Fri, 12 Sep 1997 13:00:18 -0400
From: "Raymond K. Bush" <rbush@up.net>
Subject: Re: Reading in list question
Message-Id: <34197522.857@up.net>

Joseph June wrote:
> 
> Hello,
> 
> I am a struggling perl newbie and have a problem which I have been
> struggling for a while now...
> 
> I have a data file... three columns separated by tabs... like
> 
> 198267  19823   3287123
> 12389   3891    4789
> 2913    3819    2891
> 
> and so on... currently I have a script that will read and split these guys
> into an array... for some other use... however... i now have to make an
> addition... so that file includes some more stuff... so my data file looks
> like
> 
> Joseph
> Charlie
> Al
> 
> 198267  19823   3287123
> 12389   3891    4789
> 2913    3819    2891
> 
are the records always in this format ie 

name 
name
name 

array of int
array of int
array of int

do these items correspond? ie name is associated with an int or with an
array? 

Need more detail as to your problem to help you.


> so i now have to read in the data on the top before reading in the 3
> column data... now... i think i can do this of i put a marker... like ###
> or something between the name... like
> 
> #####
> Joseph
> Charlie
> Al
> #####
> 
> 198267  19823   3287123
> 12389   3891    4789
> 2913    3819    2891
> 

--Ray
 .70~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~07.
      --- reply to rbush - at - up - dot - net ---
--- please include indication of past correspondence ---
      --- in order to receive a faster response ---


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

Date: Fri, 12 Sep 1997 11:50:01 -0700
From: Y Chen <yinso@u.washington.edu>
To: Joseph June <jjune@midway.uchicago.edu>
Subject: Re: Reading in list question
Message-Id: <Pine.OSF.3.96.970912113750.6116A-100000@saul3.u.washington.edu>

if your format is gonna be like this:

name
name
name
 .
 .
 .
num num num
num num num
 .
 .
 .

actually all you need is to figure out how many names there are going to
be in the page.  if this is not always fixed, then you might as well
assign it to like the first line of the data file. like:

<number of names>
name
name
 ...

then you just read in the number, and then write a loop to extract the
name, and then you can extract the numbers as you wish!!

example:

open F, filename;
@f = <F>;
close F;
$nameNum = $f[0];
shift @f;
$i = 0;
while ($i < $nameNum) {
	assign the names..
} 
 ...

hope this works.

yin-so		

On Fri, 12 Sep 1997, Joseph June wrote:

> Joseph
> Charlie
> Al
>   
> 198267  19823   3287123
> 12389   3891    4789   
> 2913    3819    2891   
> 



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

Date: Fri, 12 Sep 1997 15:07:57 GMT
From: jgr@tpnet.de (Jan Gruber)
Subject: Re: script to change htpasswd
Message-Id: <34195a26.181744@eunetnews.germany.eu.net>

On Thu, 11 Sep 1997 20:19:27 GMT, st93yjls@dunx1.ocs.drexel.edu
(William Hall) wrote:

>I'm trying to find a way to allow users to change their password for the 
>.htpasswd file from a web page.  I'm new to perl and cgi and can't seem 
>to find an example, but I know it can be done.  Please email the below 
>address.  Thank you.

Try wwwpass. Dont remember the url right now, if u dont find it, let
me know. To get the whole thing working, you will have to install
poppassd. Let Excite or whatever look for poppassd and wwwpass.


Bye
Jan
(jgr@tpnet.de)


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

Date: 12 Sep 1997 17:39:30 GMT
From: wilker@hopf.math.purdue.edu (Clarence Wilkerson)
Subject: Sockets under Perl 5.003 and Solaris 2.5.1
Message-Id: <5vbuoi$am0@mozo.cc.purdue.edu>

I have a perl script that works under Sunos 4.1.3_U1 and
not under Sparc or Intel 2.5.1.

It goes to the error path at this line:

# Open the connection
socket(S, $AF_INET, $SOCK_STREAM, $proto) ||
 &softErr("socket(tcp): $!")

The values submitted to socket are the same in the two OS's,
$AF_INET = 2;
$SOCK_STREAM = 1;
$structSockAddr = 'S n a4 x8';

and $proto is gotten from 
(($proto) = (getprotobyname('tcp'))[2]) || 
&hardErr("getprotobyname('tcp'): $!");

In both OS, $proto was computed as 6. On the solaris machines,
it stops at
            Soft Error: socket(tcp): Protocol not supported

That is, the socket call is not succeeding.

Help, Clarence Wilkerson



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

Date: 12 Sep 1997 18:07:42 GMT
From: gerben@cs.vu.nl (Gerben Vos)
Subject: Re: trying to execute NET USER command within script...
Message-Id: <5vc0de$2c9$1@star.cs.vu.nl>

Jerry Sheer writes:

>Trying to run 
>NET USER username password /ADD 

>from within .pl file. I can't figur out the syntax to call this procedure.
>Running on NT.40 and trying to add a user to NT from within the
>script.Thanks

system "NET USER username password /ADD";
die "Oops, an error occurred while adding the user.\n"
  if $?;

g e r b e n @ c s . v u . n l . . . . . . . . . . . . G e r b e n   V o s   <><
Join the Coalition Against Unsolicited Commercial Email!  http://www.cauce.org/
Phevbfvgl xvyyrq gur png.


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

Date: Fri, 12 Sep 1997 17:46:08 GMT
From: "Paul Holden" <paulh@irsoft.demon.co.uk>
Subject: Using Perl to access pages for Java applet
Message-Id: <01bcbfa3$c0537280$db0fdec2@irsoft.demon.co.uk>

Hi,

I've been trying to find out how to write a Perl script that will read some
web page hosted on another server, and redirect its contents to a Java
applet. As applets are allowed to read files from the server on which they
originated, the applet can easily open the script and tell it what page it
wants, for example by reading :

http://www.myserver.com/cgi-bin/grabpage?http://www.anotherserver.com/page.h
tml

the grabpage script will be run, and the applet will read in the data that
the script outputs. That bit's fine.

The problem is, I've only been programming in Perl for a months or so, and
for the life of me I can't think how to get the script to open a page on
some other server. Can anyone help? Replies via email would be much
appreciated.

Thanks in advance,
Paul Holden
paulh@irsoft.demon.co.uk


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

Date: Fri, 12 Sep 1997 18:59:50 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: Why don't my <<HERE documents work?
Message-Id: <34198c0b.853040@news.wwa.com>

Faust Gertz (faust@wwa.com) wrote:

> Why don't my <<HERE documents work?  Here is a sample of my code.
> 
> #!/user/local/bin/perl -w
> use strict;   #   'cause it's in the FAQ :-)
> print <<EOF;
> This is a test!
> EOF
> exit;
> 
> The result is:
> 
> >Can't find string terminator "EOF" anywhere before EOF at da.pl line 3.
> 
> Please note that:
> 
> 1. There is no space after the << part.
> 2. There is a semicolon at the end.
> 3. There is no space in front of the tag.

On 12 Sep 1997 08:34:09 GMT, mheins@prairienet.org (Mike Heins) wrote:

>My guess is that you uploaded the script from a DOS machine in
>binary mode, and that there is a ^M after the EOF.  If this works
>you can verify it:
>
>print <<"EOF\r";
>testing
>EOF

You are correct.  I uploaded the script from a DOS machine, but in
ASCII mode.  I did try
 
print <<"EOF\r"; 

and even 

print <<"EOF\cM";

with no luck.

On Fri, 12 Sep 1997 01:07:15 -0400, comdog@computerdog.com (brian d
foy) wrote:

>is there anything after the (supposedly) terminating EOF?  it must be
>on a line by itself.

I checked that, but thank you.

On 12 Sep 1997 08:28:55 +0200, Ronald Fischer <rovf@earthling.net>
wrote:

>Try this:
>
>print <<EOF;
>This is a test!
>EOF;       # <------ !!!!!
>exit;

No luck.

>or this:
>
>print <<EOF
>This is a test!
>EOF
>;       # <------ !!!!!
>exit;

No luck either.  But thanks.

As there seems to be other oddities with my provider's installation of
perl,

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

and

#!/user/local/bin/perl -T

sometimes returns 

>.nrecognized switch: - 

I will continue to beg, plead, and even shame my provider into
upgrading perl (thought it seems to me that these two problems are
related and that it probably has nothing to do with the version of
perl.)  If I resolve this problem, I will post the solution in case
others are having these kinds of problems.


Thanks for your help.

Faust Gertz
Philosopher at Large




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

Date: Fri, 12 Sep 1997 10:48:30 -0700
From: "Ron Aaron" <ron@mrrrossbayeng.com>
Subject: Re: win32 - piping from a command
Message-Id: <5vbvkk$sf6@news.microsoft.com>

Aaron,

    It works fine on NT with the 5.004_02 port (G. Sarathy's binaries -
EXCELLENT!).

    However, you are running on W95 (BOGUS!), but it still should work.

    Note that your print line should be:
        print "ls: $_";

    if you expect to print something other than 'ls:' over and over.

Ron Aaron

Aaron D Newman wrote in message <341956BC.4E01@ttd.teradyne.com>...
>Is there a standard way under windows95 to do this:
>
>open(IN,"\\gnu\\bin\\ls.exe|");
>while(<IN>) {
>    print "ls:";
>}
>
>This doesn't work under the ActiveWare version, I suppose because there
>is no fork().  How are people in the Win32 world handling this?  One
>hoaky way is to output to a file, and read in the file.  But this is,
>well, hoaky.
>
>BTW does anybody know how close cygnus' CDK is to compiling UNIX Perl?
>Then we'd have fork.  Cool beans.
>
>Thanks,
>Aaron
>--
>---------------------------------------------------------------------
>|  newman@ttd.teradyne.com           | "A forest is a finite         |
>|                                    | (possibly empty) set of       |
>|http://www.cirrusnet.com/~newman    | trees." - Baase               |
>---------------------------------------------------------------------




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

Date: Fri, 12 Sep 1997 11:57:44 -0400
From: Ben Raia <br2a+@andrew.cmu.edu>
Subject: Writing format to string
Message-Id: <4o6KNs_00WB_0H=mk0@andrew.cmu.edu>

Hello,

I have a very large format report, the output of which I would like to
"write" into a string to use elsewhere in my program, rather than out to
a filehandle.  Is there any way to either

1) directly write the format to a string, or 

2) somehow get a filehandle that points to a string rather than a stream
and just write to that filehandle in the normal way?

Or is there another way I can do this that I haven't thought of, given
the restriction that I would like to avoid recreating my format output
in a different way.

Thanks,
Ben Raia
br2a@andrew.cmu.edu 


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

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

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