[7361] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 986 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 6 04:18:28 1997

Date: Sat, 6 Sep 97 01:00:34 -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           Sat, 6 Sep 1997     Volume: 8 Number: 986

Today's topics:
     Re: "Odd number of elements in hash list": So? (Andrew M. Langmead)
     Best explanation of Perl variables and references? (dave)
     Re: CGI Will not recognise if or unless statements. (Mick Ghazey)
     Re: CGI Will not recognise if or unless statements. (Christoph Badura)
     Re: complex pattern?!? it shouldn't be, i think :) <rra@stanford.edu>
     Re: Converting text to Excel data with UNIX <nathan@cyberservices.com>
     Getting Perl to wait for a prompt (Andrew Kerr)
     Re: Help! cron&perl ! (Andrew Kerr)
     Re: how do I redirect the output of an existing perl sc (Mick Ghazey)
     Re: how do I redirect the output of an existing perl sc (Michael Budash)
     Re: how to use dbm with PERL? <bholzman@mail.earthlink.net>
     Implicit Creation of Complex Structures (Kevin Bass)
     Re: need script to modify .htpasswd (Jerry LeVan)
     nested data structures in Perl 4 dparsons@sirrus.com
     Re: newbie: how do I break a WHILE loop? (Andrew M. Langmead)
     Passing varaibles or parameters from perl to javascript (Henri Irla)
     Re: PERL 5.001 on WIN NT 4.0 with IIS 3.0 <nathan@cyberservices.com>
     perl and "guestbook" scripts within '95 without use of  <HR@stellarengineering.com>
     Perl5.004.01 debugger doesn't work (Mick Ghazey)
     Re: Perl5.004.01 debugger doesn't work <bholzman@mail.earthlink.net>
     Range Parsing Issue <cpw@slip.net>
     Re: Range Parsing Issue <bholzman@mail.earthlink.net>
     Re: SSH and Perl (Ian Kallen)
     Re: Sybperl - no html after $dbuse <bholzman@mail.earthlink.net>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 5 Sep 1997 21:38:04 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: "Odd number of elements in hash list": So?
Message-Id: <EG21FH.GDB@world.std.com>


Kingpin <mthurn@irnet.rest.tasc.com> writes:

>  Unfortunately, it also gives this warning if you assign undef to a
>hash.  What's wrong with that?  What's even potentially wrong with that?

>%hash = undef;

Because you are assigning a single scalar to a list structure. What
perl is really doing is essentially:

%hash = (undef => undef);

The second undef is added by perl, so that the key has a corresponding
value.

The key is then stringified so that you get:

%hash = ('' => undef);

To you want to undefine the hash entirely? If so then say:

undef(%hash);

Since undef is a function that undefines is arguments and returns and
undefined value, not a value itself (although it is one of those
strange lvalue functions.)

>  Similarly, an array which has been assigned undef shows a length of
>1 (versus an empty array, which shows a length of 0):

>@a0 = ();     print scalar(@a0);   # prints 0 as expected
>@a1 = undef;  print scalar(@a1);   # prints 1!  Why?!?

Same thing, you are assigning an undefined value into @a1. Notice what
this does:

@a2 = (undef,undef,undef);

-- 
Andrew Langmead


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

Date: Sat, 06 Sep 1997 00:29:59 GMT
From: over@the.net (dave)
Subject: Best explanation of Perl variables and references?
Message-Id: <3410a286.1668951@news.one.net>


Hi,

I'd like some recommendations as to publications in print or on line
that provide the clearest, most concise explanation of perl variables,
references, how to initialize, how to dereference, etc., etc.

I have the Camel Book and must admit that IMO treatment of variables
is spread too thinly among multiple chapters.

I need to establish good concepts in the minds of beginners, so just a
quick reference won't do either.

I plan to reference man pages for perl operators and functions, etc.

Thanks,

Dave

|
| Please visit me at http://w3.one.net/~dlripber
|
| For reply by email, use:
| dlripber@one.net
|________


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

Date: Sat, 06 Sep 1997 02:32:48 GMT
From: mick@lowdown.com (Mick Ghazey)
Subject: Re: CGI Will not recognise if or unless statements.
Message-Id: <3413c09d.47980677@news.lowdown.com>

On Fri, 05 Sep 1997 15:01:09 +0000, Dexter Plameras
<dexterp@acay.com.au> wrote:

>
>Hi
>
>I am having Trouble composing a cgi script in perl with if or unless
>statements.
>
>My System is
>	NCSA HTTPd Server 1.5.2
>	Free Bsdi 2.1.5
>	Perl 5.002
>
>This is the code excert of the code that is causeing the problem.
>
>	if(!defined($Username)
>	{
>        &err("$Param1","$ETC1","ETC2");     # &err Prints a cgi form
>	}
>	
>When running the Code on the command line it runs fine it produces html
>formatted documents. 
>
>
>But when running the form on the web it returns 
>
>	500 Server error 
>
> 	   ......etc
>
>
>
>When  I use this code it runs fine on both the command line and on the
>web.
>
>	### if(!defined($Username)
>	### {
>	&err("$Param1","$ETC1","ETC2");     # &err Prints a cgi form
>	### }	
>
>I believe it has to do with the logic statements if, unless, elsif,
>....etc.
>
>Any clues would apprieciated.
>Dexterp Plameras

It would help to see how $Username is defined. 

Mick


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

Date: Fri, 5 Sep 1997 16:43:36 GMT
From: bad@ora.de (Christoph Badura)
Subject: Re: CGI Will not recognise if or unless statements.
Message-Id: <EG1nso.C9u@ora.de>

In <34101EB5.615BCEF8@acay.com.au> Dexter Plameras <dexterp@acay.com.au> writes:
>This is the code excert of the code that is causeing the problem.

>	if(!defined($Username)
>	{
>        &err("$Param1","$ETC1","ETC2");     # &err Prints a cgi form
>	}
>	
>When running the Code on the command line it runs fine it produces html
>formatted documents. 

If this code actually runs from the command line and produces html, then
there is something seriously wrong with the perl you use.

This code is supposed to bomb out with a syntax error because there
is a closing parenthesis missung the the line with the "if".
-- 
Christoph Badura

Now available in print: Lion's Commentary on UNIX 6th Edition, with Source Code
			http://www.peer-to-peer.com/


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

Date: 05 Sep 1997 18:56:50 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: complex pattern?!? it shouldn't be, i think :)
Message-Id: <m3n2lrdx25.fsf@windlord.Stanford.EDU>

Randal Pittelli <pittelli@ehsct7.envmed.rochester.edu> writes:
> Randal Schwartz wrote:

>> <!-- -- -->
>> If you see this, you have a buggy browser. Perhaps you should
>> <A HREF="http://lynx.browser.org/">upgrade to Lynx</A>?
>> <!-- -- -->

> That's absurd. How could the comment be defined to allow for that text
> to be hidden???? There is no rational difference between the 1st and 2nd
> `-->`.

This is getting rather off-topic for a Perl newsgroup, but if you review
the specification of SGML comments, you'll find that they're defined as:

        <!-- first comment -- -- second comment -->

In other words, each -- -- encloses a comment.  So the above block of code
creates one comment containing just a space and a second comment
containing the text:

        >
        If you see this, you have a buggy browser. Perhaps you should
        <A HREF="http://lynx.browser.org/">upgrade to Lynx</A>?
        <!

and then a third comment containing a space.  Very few browsers parse this
sort of thing correctly.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Fri, 05 Sep 1997 22:58:09 +0000
From: Nathan Stanford <nathan@cyberservices.com>
To: Joe Petrow <joepet@server.berkeley.edu>
Subject: Re: Converting text to Excel data with UNIX
Message-Id: <34108E81.73EE6C8D@cyberservices.com>

Don't pay someone to do it get a perl book it is not that hard to do.


Joe Petrow wrote:

> Could somebody point me to some information on a Perl routine that
> converts tab delimited text data in native Excel format?
>
> Or if not that, to a place that specifies exactly what native Excel
> format
> is?
>
> Thank you.
>
> Joe Petrow
> joepet@server.berkeley.edu
> http://server.berkeley.edu/~joepet





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

Date: 6 Sep 1997 04:07:32 GMT
From: kerr@cs.uregina.ca (Andrew Kerr)
Subject: Getting Perl to wait for a prompt
Message-Id: <5uqku4$5pg$1@sue.cc.uregina.ca>

I'm trying to write one of those infamous password changing scripts.
So far, what I've got works fine, it accepts the username, password,
new password, and confirmation of the new password.  It performs some
basic checks, does the username exist, does the password match, do
both newpasswords match each other, etc.  

At this point, I would like to use passwd to actually change the
password by calling it with the appropriate username.  My problem is,
how do I get perl to wait for the password prompt and then give it
the password, wait for the new password, then give it the new password, 
etc.

Any ideas, pointers to online stuff, or even code would be appreciated.


Andrew

--
Andrew Kerr   
Email:      kerr@tdi.uregina.ca
Alternate:  kerr@3co.com
Homepage:   http://tdi.uregina.ca/~kerr/index.html                     
Logic is a little bird, sitting in a tree, that smells AWFUL.


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

Date: 6 Sep 1997 00:47:08 GMT
From: kerr@cs.uregina.ca (Andrew Kerr)
Subject: Re: Help! cron&perl !
Message-Id: <5uq96c$eba$1@sue.cc.uregina.ca>

Ronald L. Parker (ron@farmworks.com) wrote:
: On 3 Sep 1997 05:31:14 GMT, Tero Tuononen <tuononen@cc.helsinki.fi>
: wrote:

: >Hi there !
: >
: >I am having problems with the following structure:
: >
: >I have few perl scripts that work fine when executed from commandline
: >and in proper directory. When I call these very same scripts from
: >cron it does not work anymore. There is one script that is called from
: >cron and then the script itself calls for more scripts when it generates
: >proper commandlines to do some daily routines with daily changing files. All
: >the stuff is located in the same directory but is there still a problem
: >with paths or what ? The script cannot access some file that surely are
: >in the same directory...it also has major difficulties copying result
: >files to some subdirectories and so on. 
: >

: Perhaps it has the wrong working directory when run from cron.  If the
: suggestions from other posters haven't helped, try adding this to the
: beginning of the script:

: chdir(($0=~m#(.*)/#)[0]);

What I have always done (and continue to do) with perl scripts running from
a cron job, is to path out everything.  So my crontab list 
/path/to/my/home/dir/perlscripts/script.pl and the script has the same idea
in it.  For example, I have one that updates my .plan file everyday and
it paths right out to my .plan and the random tagline generator that's
put into my plan.


Andrew

--
Andrew Kerr   
Email:      kerr@tdi.uregina.ca
Alternate:  kerr@3co.com
Homepage:   http://tdi.uregina.ca/~kerr/index.html                     
Logic is a little bird, sitting in a tree, that smells AWFUL.


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

Date: Sat, 06 Sep 1997 02:30:10 GMT
From: mick@lowdown.com (Mick Ghazey)
Subject: Re: how do I redirect the output of an existing perl script
Message-Id: <3411bf5c.47660122@news.lowdown.com>

On Fri, 5 Sep 1997 10:41:39 -0700, "Peter Tiemann" <peter@preview.org>
wrote:

>I'd like to redirect the standard output of a perl function that I call.
>(Right now it writes on the screen = in a web page in my particular case)
>I would like to have that function write to a file to be able to process the
>output.
>
>Thank you for helping a beginner -
>Peter Tiemann,
>peter@preview.org
>
>

You can redirect it like any other program using the '>' redirector.
Otherwise you can edit the script.

You can also edit all print statements to print to a file. The print
statement is explained very well in the perl man pages and in all
books about Perl. 

Mick


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

Date: Sat, 06 Sep 1997 00:07:12 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: how do I redirect the output of an existing perl script
Message-Id: <mbudash-0609970007120001@d55.pm8.sonic.net>


In article <5upg2n$ro6$1@ha1.rdc1.sdca.home.com>, "Peter Tiemann"
<peter@preview.org> wrote:

> I'd like to redirect the standard output of a perl function that I call.
> (Right now it writes on the screen = in a web page in my particular case)
> I would like to have that function write to a file to be able to process the
> output.
> 

First, before any "print..." statements:

  open (FILE_NAME, ">>file_name") || die;

Then, wherever there is a "print ..." statement, change it to "print
FILE_NAME ...".

Finally, purists would have you do this when you're through with the file:

 close (FILE_NAME);

Note that "FILE_NAME" is just a placeholder (actually it's called a
filehandle name), so name it whatever you want. On the other hand,
"file_name" is the actual filename you want to write to. ">>" means append
to the file, and create it if it doesn't already exist.

Questions?

                   _____________________________

                       Michael Budash, Owner
                     Michael Budash Consulting
                           707-255-5371
                   http://www.sonic.net/~mbudash
                         mbudash@sonic.net
                   _____________________________


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

Date: Fri, 05 Sep 1997 22:57:16 -0400
From: Benjamin Holzman <bholzman@mail.earthlink.net>
Subject: Re: how to use dbm with PERL?
Message-Id: <3410C68C.98795495@mail.earthlink.net>


[posted & mailed]
Kuntal M Daftary wrote:
> 
> i wanted to use DBM with PERL for makeing a database.
> i found some reference about sunctions i can use for that in PERL like
> dbmopen and dbmclose. they are supposed to read dbm files. but how do i make
> a dbm file in the first place using PERL?
> 

>From perlfunc:
dbmopen ASSOC,DBNAME,MODE 
     [This function has been superseded by the tie() function.] 

     This binds a dbm(3), ndbm(3), sdbm(3), gdbm(), or Berkeley DB file
to an associative
     array. ASSOC is the name of the associative array. (Unlike normal
open, the first
     argument is NOT a filehandle, even though it looks like one).
DBNAME is the name of
     the database (without the .dir or .pag extension if any). If the
database does not exist,
     it is created with protection specified by MODE (as modified by the
umask() ). If your
-----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     system only supports the older DBM functions, you may perform only
one dbmopen()
     in your program. In older versions of Perl, if your system had
neither DBM nor ndbm,
     calling dbmopen() produced a fatal error; it now falls back to
sdbm(3). 

     If you don't have write access to the DBM file, you can only read
associative array
     variables, not set them. If you want to test whether you can write,
either use file tests
     or try setting a dummy array entry inside an eval() , which will
trap the error. 

     Note that functions such as keys() and values() may return huge
array values when
     used on large DBM files. You may prefer to use the each() function
to iterate over
     large DBM files. Example: 

         # print out history file offsets
         dbmopen(%HIST,'/usr/lib/news/history',0666);
         while (($key,$val) = each %HIST) {
             print $key, ' = ', unpack('L',$val), "\n";
         }
         dbmclose(%HIST);


     See also AnyDBM_File for a more general description of the pros and
cons of the
     various dbm approaches, as well as DB_File for a particularly rich
implementation. 


> secondly, how do search among the keys of dbm file based on a regex?
> 
> eg, i want the dbm entry which has a key matching the following regex:
> 
> /^..hellow?b[0-9]*$/
> 
> so that the result of the search is something like this:
> 
> abhellob234234
> bchellowb34234
> dohellowb743

Unfortunately, you're not going to be able to do anything too efficient
here.  You're going to have to brute force search through all the keys,
something like this:

while (($k, $v) = each %db) {
   print $v if $k =~ /$pattern/;
}

You should _not_, however, do this:

map {print $db{$_} if /$pattern/} keys %db;

This will create an intermediate array containing all the keys in the
database, which, depending on how many keys you have, could use a _lot_
of memory...

Hope this helps,

Benjamin Holzman


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

Date: Sat, 06 Sep 1997 04:44:07 GMT
From: akil1@mindspring.com (Kevin Bass)
Subject: Implicit Creation of Complex Structures
Message-Id: <5uqn3c$i3@camel12.mindspring.com>

If this line of code was the first line in a program :

$sue('children') -->[1] -->{age} = 10;

Perl would automatically create the hash %sue.  How would the
structure of the hash %sue look?

Kevin



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

Date: 5 Sep 1997 21:37:19 -0400
From: levan@eagle.eku.edu (Jerry LeVan)
Subject: Re: need script to modify .htpasswd
Message-Id: <5uqc4f$89r$1@eagle.eku.edu>

Here is what I use for mhttpd password files.

--Jerry
  levan@eagle.eku.edu

#!/usr/bin/perl
# Author:	Jerry LeVan
# Date:		April , 1997
# Purpose:	Generate and write password info into a user specified file.
# Usage:	mkpw <path to password file>

  srand();
  @alphabet = ('a' .. 'z', 'A' .. 'Z', '0' .. '9', '.', '/');

  # open file in append mode
  open (FD,">>$ARGV[0]") or die "Can't Open $ARGV[0] Usage: mkpw path-to-pwfile";
  print "Enter ^d (or empty line) when asked for user name to exit program\n";
  while(1) {
    print "Enter user name: ";
    chomp ($user=<STDIN>);
    exit unless $user;  # the exit will close the file
    $salt = join ('', @alphabet[rand (64), rand (64)]);

    system 'stty -echo';
    print "Enter new password: ";
    
    chomp($result = <STDIN>);
    print "\nRepeat: ";
    chomp($plaintext=<STDIN>);
    print "\n";
    system 'stty echo';
  # They better be the same
    if ($plaintext ne $result) {
      print "Sorry, they don't match,entry not created.\n";
      next ;
    }

    $encrypted = crypt ($plaintext, $salt);
    print FD "$user:$encrypted\n";
}



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

Date: Fri, 05 Sep 1997 21:11:51 -0600
From: dparsons@sirrus.com
Subject: nested data structures in Perl 4
Message-Id: <873509142.25312@dejanews.com>


Does anyone know of a way to construct an array of associative arrays
in Perl 4, such that the individual associative arrays don't get
glommed together and can later be extracted out again?

My problem is that I decided to represent "objects" as associative
arrays which map field names to their associated values.  This has
worked fine for my needs so far, but now I need to return an array of
objects from a subroutine and have the caller be able to interpret the
result as the original array of objects (and not as one huge array).
In the case that all the objects are of the same type, the caller can
figure out where one object ends and the next one starts based on the
number of fields in the object (not elegant, but it works). However,
if the objects are of diverse type, I have no solution.  (BTW I don't
have the luxury of "join"-ing each object into a string, because there
isn't a unique delimiter which can be guaranteed not to be part of an
object's data.)

If anyone has a suggestion about how to parse associative arrays out
of a containing array, or about an alternative representation of
objects which doesn't suffer from this problem, I will be v. grateful.
(And please don't suggest Perl 5 -- I'd love to, but sadly I don't
have the option.)

Thanks,

David

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


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

Date: Fri, 5 Sep 1997 21:28:59 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: newbie: how do I break a WHILE loop?
Message-Id: <EG210C.Ar6@world.std.com>


williamw@rooster.igs.deleteTheRooster.net (William Wue(2xP)elma(2xN)) writes:

>If you're going to use a label, you might as well use a goto.


Not necessarily. First you have nested loops.

OUTER: while(<FILE>) {
INNER:  while(<FILE2>) {
    last OUTER if /$somepatttern/o;
  }
}


Secondly, loop modifiers (with or without labels) effect the
evaluation of the conditional expression in ways that a goto will not.

Thirdly, goto is coded horribly inefficiently in perl. And since no
one seems to be interested in fixing it, it will probably always be
that way.

-- 
Andrew Langmead


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

Date: 6 Sep 1997 06:47:08 GMT
From: henri@eva.univ-perp.fr. (Henri Irla)
Subject: Passing varaibles or parameters from perl to javascript module ?
Message-Id: <5uqu9c$3vg@ws41.cnusc.fr>

HI,
I vould pass variable or parameters from  CGI perl program to javascript module.
CGI perl module create dynamicaly html page with data information .
there is javascrip module in this dynamic jtml page created . how can use parameters or variable from  perl program to javascrip module ? 


any help would be apreciate .
please can send you Email

---


Best regards from sunny Pyrenees near the Mediterannee sea ...

Henri.

         -------------------------------------------------------
   Henri  Irla            Email : hi@univ-perp.fr - henri@eva.univ-perp.fr
   Inginieur - Consultant                  
   Systhmes & Traitement de L'information     
   Chemin du Mas de L'arbre
   66350 Toulouges - France              http://gala.univ-perp.fr/~hi
         --------------------------------------------------------



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

Date: Fri, 05 Sep 1997 23:14:25 +0000
From: Nathan Stanford <nathan@cyberservices.com>
To: dRAGoNFLy <mEu@mindless.com>
Subject: Re: PERL 5.001 on WIN NT 4.0 with IIS 3.0
Message-Id: <34109251.1654C8BB@cyberservices.com>

dRAGoNFLy wrote:

> Hello,
>
> I have serious trouble installing perl on my IIS 3.0 webserver. I want
> to
> install perl on the Webserver HD (which is easily done with
> install.bat I
> guess) but after that I create a directory called "cgi-bin" in the
> wwwroot
> directory, I make it executable with the Internet Service Manager and
> I map
> it so that http://azul/cgi-bin is the cgi-bin directory. Works fine,
> but
> then comes the problem, when I put a simple script in the cgi-bin
> directory
> and a html file in the samples directory, and I press my submit button
>
> (it's a simple search engine) I arrive at the search.pl script with
> the
> nice error: HTTP/1.0 501 Not Supported
> I think he doesn't recognize the .pl file and he doesn't associate it
> with
> the perl.exe interpreter.
> Can somebody please help me out with this because it's rather
> important.
> BTW I ain't a Windows NT specialist or IIS 3.0 freak either (yet :)
>
> Thanks in Advance,
>
> Dominique

   Actually it is easy....

1. go to

ftp://ftp.ActiveState.com/Perl-Win32/Release/

get the version ...306 i stands for intel   there are three files   the
307 has had some problems with getting the data from forms.

install the largest file first then the next two then

you have to go in the registry to modify
My Computer\HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3SVC

Right click and add a string .pl
then double click on the string and in the path put the path do the perl
dll file.
close the regeidt and then reboot the server and perl show work fine...

If you have problems email me and I 'll get ahold of you one way or
another.



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

Date: Fri, 05 Sep 1997 20:24:22 -0700
From: Stellar Engineering Inc <HR@stellarengineering.com>
Subject: perl and "guestbook" scripts within '95 without use of mailer
Message-Id: <3410CCE6.4D7C92A4@stellarengineering.com>

I was wondering if anybody knew how I could use perl to process a form
in html and write the data in the form into a file, like a diary or
journal, on a Windows '95 OS that isn't hooked up to any network or
outside dialer..????  I am trying to write a program that will keep a
diary of conversations I have had with other people on my home
computer...

If what I am asking isn't possible how would i do it using peer-to-peer
networking in Windows '95???

Thanks
Mike




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

Date: Sat, 06 Sep 1997 02:25:01 GMT
From: mick@lowdown.com (Mick Ghazey)
Subject: Perl5.004.01 debugger doesn't work
Message-Id: <3410bc38.46855538@news.lowdown.com>

The perl debugger doesn't work on my system. It seg-faults every time
you try to debug anything. The problem started when I upgraded to
per5.004.01 It doesn't matter what script you debug. The script can be
a simple one-liner consisting of "#!/usr/bin/perl". I've tried plenty
of scripts.

I've been working on this problem all week. Please help if you can.

Thanks.

Mick



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

Date: Sat, 06 Sep 1997 00:50:08 -0400
From: Benjamin Holzman <bholzman@mail.earthlink.net>
To: Mick Ghazey <mick@lowdown.com>
Subject: Re: Perl5.004.01 debugger doesn't work
Message-Id: <3410E100.3948338@mail.earthlink.net>

Mick Ghazey wrote:
> 
> The perl debugger doesn't work on my system. It seg-faults every time
> you try to debug anything. The problem started when I upgraded to
> per5.004.01 It doesn't matter what script you debug. The script can be
> a simple one-liner consisting of "#!/usr/bin/perl". I've tried plenty
> of scripts.
> 
> I've been working on this problem all week. Please help if you can.
> 
> Thanks.
> 
> Mick
It might help if you said what system you're on...


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

Date: Fri, 05 Sep 1997 21:08:03 +0000
From: Coburn Watson <cpw@slip.net>
Subject: Range Parsing Issue
Message-Id: <341074B3.2381@slip.net>

This might be a pretty basic question but a solution didn't jump out at me from my Camel
or Llama book; either my brains failing or I need to stop being a part-time Perl'r.

I have a text file which contains about 100 records.  These text records are identified
by a header line which matches:

/^\@{3,4}\d{8}/

I would like parse out the data from the beginning of a specific article up to the
beginning of the next article.  The only info I have is the number of the desired
article, but not that of the following.  So I might want article 12345678 (beginning
with @@@12345678).  If I do the following:

$article_id=12345678;
while(<INFILE>) {
if (/^\@{3,4}$article_id\) {
until (/^\@{3,4}/) {
        print;
        }}}

It starts and terminates on the first line which matches.  Is there some way to make the
until clause something like: (/^\@{3,4}(not $article_id)/ ?  I would greatly appreciate
any help on this matter.  Much thanks in advance.

Coburn Watson
Systems/DB Admin.
cpw@slip.net

p.s. I was able to perform this in awk setting FS and RS accordingly, but the record
text is two long for awk/nawk and they choke.


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

Date: Sat, 06 Sep 1997 01:00:14 -0400
From: Benjamin Holzman <bholzman@mail.earthlink.net>
To: cpw@slip.net
Subject: Re: Range Parsing Issue
Message-Id: <3410E35E.79E5C1A1@mail.earthlink.net>

[posted & mailed]
Coburn Watson wrote:
> 
> This might be a pretty basic question but a solution didn't jump out at me from my Camel
> or Llama book; either my brains failing or I need to stop being a part-time Perl'r.
> 
> I have a text file which contains about 100 records.  These text records are identified
> by a header line which matches:
> 
> /^\@{3,4}\d{8}/
> 
> I would like parse out the data from the beginning of a specific article up to the
> beginning of the next article.  The only info I have is the number of the desired
> article, but not that of the following.  So I might want article 12345678 (beginning
> with @@@12345678).  If I do the following:
> 
> $article_id=12345678;
> while(<INFILE>) {
> if (/^\@{3,4}$article_id\) {
> until (/^\@{3,4}/) {
>         print;
>         }}}
> 
> It starts and terminates on the first line which matches.  Is there some way to make the
> until clause something like: (/^\@{3,4}(not $article_id)/ ?  I would greatly appreciate
> any help on this matter.  Much thanks in advance.
I think what you want to do is this:

while (<INFILE>) {
  if (/^@{3,4}(\d+)/) {
    $in_article = ($1 == $article_id);
  }
  print if $in_article;
}

Hope this helps,

Benjamin Holzman


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

Date: 6 Sep 1997 07:26:10 GMT
From: spidaman@well.com (Ian Kallen)
Subject: Re: SSH and Perl
Message-Id: <5ur0ii$svf$1@was.hooked.net>

: system('/usr/local/bin/scp','-Bpr',$src,$dest);

: work for me.  If you find something better, please post it up!

use rsync; # ;)
ftp://samba.anu.edu.au/pub/rsync/
and do this
#!/perl
foreach $h (@hosts) { rsync -ave ssh /local/filesystem/ $h:/replica/path/ }
and check out http://www.arachna.com/webservers/distributed_servers.html
-Ian

: >I am currently trying to write a perl script that will utilize ssh and scp
: >to
: >
: >	1)  Copy files to many different servers automatically;
: >	2)  Execute commands on many different servers automatically;
: >
--


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

Date: Sat, 06 Sep 1997 00:49:04 -0400
From: Benjamin Holzman <bholzman@mail.earthlink.net>
To: lane.mabbett@eds.com
Subject: Re: Sybperl - no html after $dbuse
Message-Id: <3410E0C0.207B00BB@mail.earthlink.net>

[posted & mailed]
lane.mabbett@eds.com wrote:
> 
> I know there has to be a simple explanantion why the following is not
> happening.  I am using Perl 5 on Solaris 2.5.1, performing a simple query
> using Sybperl on Sybase System 11.  I am able to format HTML in my script
> until after I issue the &dbuse command.  After that, no HTML is sent to
> my browser.  Everything works fine, however, when the script is executed
> from the command prompt.  I am completely stumped.  Here is a section of
I bet if you type "echo $SYBASE" from the command line, you'll see
something like "/opt/sybase".  Whatever you see probably needs to be set
up in your CGI script; add this:
BEGIN { $ENV{'SYBASE'} = '/opt/sybase' }

Hope this helps,

Benjamin Holzman


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

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

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