[6255] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 877 Volume: 7

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Feb 1 03:08:38 1997

Date: Sat, 1 Feb 97 00:00:28 -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           Sat, 1 Feb 1997     Volume: 7 Number: 877

Today's topics:
     Re: Bug ? in Perl 5.003 for linux - or just me ?? (Nathan V. Patwardhan)
     Re: Bug? Passing Empty Array To Subroutine (Dave Thomas)
     Re: CGI SCRIPT / PERL Setup and Executing of scripts (Bob Wilkinson)
     Re: Color coding perl <arichards@postoffice.worldnet.att.net>
     Re: Commercial success stories using perl. <arichards@postoffice.worldnet.att.net>
     Re: dealing w/ junk e-mail OR how to mail from perl scr (Tad McClellan)
     Re: Filehandle: open(FILE) while{} close(FILE) (Nathan V. Patwardhan)
     Re: Filehandle: open(FILE) while{} close(FILE) (Dave Thomas)
     Re: Filehandle: open(FILE) while{} close(FILE) (Tad McClellan)
     Finding weekends of a particular year? idoh@cais.com
     flock() Function Question (Ralph Freshour)
     How to use perl <ezarrabi@direct.ca>
     Re: Invoking Perl program (Tad McClellan)
     Re: Multithreadin' (Nathan V. Patwardhan)
     NTPERL Serial Port Problem <thayer@wcax.com>
     Re: Password Program Help <akt1@stern.nyu.edu>
     Re: Perl on Microsoft IIS <arichards@postoffice.worldnet.att.net>
     perl script ouput from html form futurecard@netstorage.com
     perl-mod on apache giving errors (Matthew Ahrens)
     Re: PerlScript (was Re: Heard rumor of MS Perl!!) (Devin Jones)
     Re: Script Timing Out dave@okvalley.com
     Re: Syntax error (Tad McClellan)
     The excape character sequence <akt1@stern.nyu.edu>
     Re: uuencoding (Nathan V. Patwardhan)
     Re: Why I think so (Re: "-i" switch is unsafe!) (Reinhold J. Gerharz)
     Re: Win32:Service::StartService Problem ! <akt1@stern.nyu.edu>
     Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)

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

Date: 1 Feb 1997 03:06:51 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Bug ? in Perl 5.003 for linux - or just me ??
Message-Id: <5cuc0b$feq@fridge-nf0.shore.net>

Christopher Burke (C.Burke@mailbox.uq.edu.au) wrote:

: if I call it like
: process_file();

Are you flushing buffers properly?  $|=1; should be at the top of your
program.

--
Nate Patwardhan | nvp@shore.net
"Lane, this is pure snow!  Do you have any idea what
the street value of this mountain is?"
	--Charles Demar from _Better Off Dead_


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

Date: 1 Feb 1997 04:13:24 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: Bug? Passing Empty Array To Subroutine
Message-Id: <slrn5f5gim.6cj.dave@fast.thomases.com>

On 1 Feb 1997 00:43:35 GMT, Paul Baleme - PCD ~ <pbaleme@pcocd2.intel.com> wrote:
> 
> When passing the 0'th element of a non-existent array, perl5 seems
> to create an entry in the array.  Example:
> 
> 
> --cut--
> print "$#array\n";
> &foo($array[0]);
> print "$#array\n";
> 
> sub foo {}
> --cut--
> 
> prints:
> -1
> 0

I _think_ this may be a side effect of the fact that references "spring into
existence" in Perl 5. Although the array is sized according to the
referenced entry, if you have a look at the actual entry $array[0], you'll
find its undefined.

There is also a difference between foo($array[0]) and foo($array[0]+1) -
the first case extends the array, the second complains about $array[0] being
undefined.

Interesting...

Dave



-- 

 _________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: Fri, 31 Jan 1997 14:47:37 -0500
From: b.wilkinson@pindar.co.uk (Bob Wilkinson)
Subject: Re: CGI SCRIPT / PERL Setup and Executing of scripts
Message-Id: <b.wilkinson-3101971447370001@ip57-york.pindar.co.uk>

In article <01bc0f14$659bc080$218c53c6@rockhead.camalott.com>, "Darrell
LaRock" <rockhead@camalott.com> wrote:

> I am learning scripts and forms currently.  Now I am following a tutorial
> and it doesnt cover the problem I ran into.
> 
> My ISP currently has perl in the directory /usr/bin/perl and is running
> Linux
> now I have type in a basic script here it is
> 
> #! /usr/bin/perl
> 
> # testform.cgi, written january 30, 1997
> 
> require "cgi-lib.pl";
> require "ctime.pl";
> 
deletia
> 
> I also didnt noticed that my ISP does not have any of the librarys such as
> (cgi-lib.pl) located with perl.  I was even unable to find in another
> directory.  Please can someone help me.  I am lost and confused.

Try "using CGI.pm" - it's more recent than cgi-lib.pl, and provides much the
same functionality (and, is in my opinion, easier to use). If this isn't
installed, you could install either of these libraries into your local directory
and point your scripts at the libraries.

Bob

-- 
All is flux, nothing is still; nothing endures but change
- Heraclitus


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

Date: Fri, 31 Jan 1997 23:03:57 -0700
From: Adam Richards <arichards@postoffice.worldnet.att.net>
Subject: Re: Color coding perl
Message-Id: <32F2DCCD.3AC9@postoffice.worldnet.att.net>

try WinEdit  decent color coding once you
modify the croma.ini and/or create your own pl.ini.

easy to drag and drop in windows.

abr


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

Date: Fri, 31 Jan 1997 23:08:20 -0700
From: Adam Richards <arichards@postoffice.worldnet.att.net>
Subject: Re: Commercial success stories using perl.
Message-Id: <32F2DDD4.7826@postoffice.worldnet.att.net>

This is a common concern in big business.

The meat of the matter is that PERL source code 
is available.  If you can get the source code, and
re-build perl, then you 'have' effectively created
(re-created) the application.

Thus, it is viable.
MCI uses perl internally, but I am not aware of
too much production.  Also, Microsoft ships a limited
perl (not alot of livrary modules)
executable with its resource kits.

QED


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

Date: Fri, 31 Jan 1997 22:34:57 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: dealing w/ junk e-mail OR how to mail from perl script?
Message-Id: <h5huc5.1c4.ln@localhost>

Phil Ptkwt Kristin (ptkwt@teleport.com) wrote:

: I'm really fed up with getting several junk e-mail messages/day.  I've got
: a plan to retaliate....

: The plan is to write a perl script that sends a reply mail to the
: offending junk e-mailer every 2 minutes or so.  Should be simple.


You know of course, that this could be seen as a "denial of service
attack" on the spammer? Which is illegal.

Besides that, most spammers either forge their address, or feed
all replies straight into the bit bucket. So it will be no skin
off of their nose if you do this. (ie. they may never even know
you did it).

Sometimes, by doing 'whois' on their domain, or searching
dejanews, you can find their _personal_ email address, rather
than the bogus one they use in their spams. Fire away at
those addresses ;-)



A much more effective approach is to write a _polite_ (the
sysadmins didn't do the spamming) email to their access provider.

This may actually result in stopping them. Your approach is futile.

If it is a rogue ISP who is giving them access, then send email
to their upstream access provider (poke around in the email
headers to find out who is upstream).



Also, I now *never* email to spammers, only to their providers.

These folks are evil nasty people (of course, they're spammers, 
after all). I once got one on my case after my complaints to
the provider got them booted. I got multiple emails everyday,
until my complaint to their new provider got them booted from
there too!

Sending email to spammers is a waste of time. Send email 
(just one ;-) to their _providers_ instead.


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 1 Feb 1997 03:18:43 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Filehandle: open(FILE) while{} close(FILE)
Message-Id: <5cucmj$feq@fridge-nf0.shore.net>

Kenneth W. Lee (kenlee@congo.morgan.com) wrote:

Here's how I revised your code (for better or worse :-) :

I chose to slurp everything into an array so I could use foreach instead
of while.  I don't/didn't know why you were using $outfile in your die()
statement, because you wanted to append to $infile, right?  :-)

My datafile contained:
THIS THAT THE OTHER THING

When the program was done, it contained:
THIS THAT THE OTHER THING
HeeHIS HeeHAHee HeeHE OHeeHER HeeHING

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

### main
&two_files();

sub two_files {

    my @lines; ### array
    my $infile = "DATA.TXT";
    
    open (INFILE, "<$infile") or die "Cannot open $infile:$!\n";
    open (OUTFILE, ">>$infile") or die "Cannot create $outfile:$!\n";
					### why do you have $outfile?

    @lines = <INFILE>; ### debbie does array

    foreach $line (@lines) { ### nab something from the array
	$line =~ s/T/Hee/g; ### greed!
	print $line;
	print OUTFILE $line; ### to file
    }
    
    close(INFILE) or die "Can't close $infile: $!";
    close(OUTFILE)or die "Can't close $infile: $!";

}

--
Nate Patwardhan | nvp@shore.net
"Lane, this is pure snow!  Do you have any idea what
the street value of this mountain is?"
	--Charles Demar from _Better Off Dead_


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

Date: 1 Feb 1997 03:58:40 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: Filehandle: open(FILE) while{} close(FILE)
Message-Id: <slrn5f5fmv.6cj.dave@fast.thomases.com>

On 31 Jan 1997 18:39:28 -0500, Kenneth W. Lee <kenlee@congo.morgan.com> wrote:

> #!usr/bin/perl5 -w
                   ^ excellent start here!
> {
>     my $line;
>     my $infile = "DATA.TXT";
> 
>     open ( INFILE, "<$infile" ) or die "Cannot open $infile:$!\n";
>     open ( OUTFILE, ">>$infile" ) or die "Cannot create $outfile:$!\n";
> 
>     $line = <INFILE>;
>     while ( $line )
              ^^^^^--- $line becomes false when empty, '0' or undefined.
	               It's unlikely the body of your loop will make it
		       so, so the loop won't terminate.
>     {
> 	s/FOO/BAR/;   # any kind of parser here
        ^^^^^^^^^^
	         ----- The s/// operator like this operates on the special
		       $_ variable, so $line won't be touched.
> 	print $line;
> 	print OUTFILE $line;
>     }
>     close( INFILE ) or die "Can't close $infile: $!";
>     close( OUTFILE )or die "Can't close $infile: $!";
> }


A simpler way to rewrite the loop might be:

    while (<INFILE>) {
       s/FOO/BAR/;
       print;
       print OUTFILE;
    }
    
    
Regards

Dave

-- 

 _________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: Fri, 31 Jan 1997 22:44:01 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Filehandle: open(FILE) while{} close(FILE)
Message-Id: <hmhuc5.nc4.ln@localhost>

Kenneth W. Lee (kenlee@congo.morgan.com) wrote:

: Question:
: I'm having some difficulty with filehandles.  

No, you are having some difficulty with loop control.

Filehandles aren't involved in your problem.


: I've consulted
: the _Programming Perl_ (O'Reilly, 91) and _Perl5: How-To_
: (Waite Group, 96), but still have no idea what is wrong
: with the code below (I know I could do it in a line-command,
: but I'd like to learn how to code in the most verbose but
: elegant way):

: ---begin code---
: #!usr/bin/perl5 -w

: #
: # main
: #

: {
:     my $line;
:     my $infile = "DATA.TXT";

:     open ( INFILE, "<$infile" ) or die "Cannot open $infile:$!\n";
:     open ( OUTFILE, ">>$infile" ) or die "Cannot create $outfile:$!\n";

:     $line = <INFILE>;
:     while ( $line )
:     {
: 	s/FOO/BAR/;   # any kind of parser here
: 	print $line;
: 	print OUTFILE $line;
:     }
:     close( INFILE ) or die "Can't close $infile: $!";
:     close( OUTFILE )or die "Can't close $infile: $!";
: }
: ---end code---

: This problematically runs an endless loop 


Of course it does. You _told_ it to ;-)


1) you read *one line* from <INFILE>, and then you never read
   anything else from it!

2) you have the standard cause of infinite loops. That is, your
   loop control variable ($line) in *never modified* inside of
   the loop, so once you get in, you can never get out...



You probably really wanted something like:

while ( $line = <INFILE>)
{
   s/FOO/BAR/;   # any kind of parser here
 ...
}


: when I'd like
: it terminated upon the last line of <INFILE>.  Is there 
: something I've missed?


: Thanks in advance,

Hope this helps!


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Fri, 31 Jan 1997 20:56:49 -0600
From: idoh@cais.com
Subject: Finding weekends of a particular year?
Message-Id: <854764095.31864@dejanews.com>

Has anyone written code or knows of one that will give all weekends for a
particular year?

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


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

Date: Sat, 01 Feb 1997 04:08:19 GMT
From: rfresh@mail.idt.net (Ralph Freshour)
Subject: flock() Function Question
Message-Id: <32f2c128.9528099@news.ios.com>

In my perl code I'm not sure my flock() is working correctly.  I have
a log file that records the hh:mm:ss when each piece of mail comes
into primemail.  This file shows (at times) 2 pieces of mail coming in
at the exact same time (at least to the whole seconds anyway).  I have
another function that records the mail headers for each piece of mail.
But when I look at the timing log at those pieces of mail that came in
at the same time, I see only one mail header log entry where there
should be two.

I'm wondering if my flock() is working or not.  I thought that flock()
would hold the 2nd task until the 1st finished but it seems like the
2nd task is just running on by and not bothering to wait to write to
the header log when the task immediately before it has the header log
locked.

Any thoughts???  The following code snippet is an example of how I use
the flock() function for reading and writing files:

open (MMCFG, "$filename");#I do use the if statement to check for OK
flock(MMCFG,$LOCK_EX);#exclusive lock == 2
seek(MMCFG, 0, 0);#move to beginning of file
@cfgFileBuffer = <MMCFG>;#read or write to the file - whichever
flock(MMCFG,$LOCK_UN);#unlock == 8
close (MMCFG);

--Ralph



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

Date: Fri, 31 Jan 1997 23:44:30 -0800
From: ehsan zarrabi <ezarrabi@direct.ca>
Subject: How to use perl
Message-Id: <32F2F45E.2BEB@direct.ca>

How do I use a perl script? I have downloaded a perl script but I don't
know how to use it, I mean how to call it. Do I have to add a line in my
web page so it goes and runs the perl script or what?

Please answer that!


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

Date: Fri, 31 Jan 1997 22:22:22 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Invoking Perl program
Message-Id: <udguc5.ca4.ln@localhost>

Maksym I Panfilov (mpanfilo@newstand.syr.edu) wrote:

: I'm am new to Perl and tryed to invoke Perl program from Web browser. So,
: here is HTML file:

[ snip HTML ]

: This is Perl program which is stored in my public_html dir:

[ snip perl code ]

: From within Unix this Perl program runs. Tutorial says that when i click
: on a Perl's program link from a browser it should return appropriate
: information in correct HTML format directly to the browser. Unfortunately,
: after invoking the program via link I receive just a text of a program,
: not HTML formatted page. It should be noted that I made Perl's program
: executable.

: So, what did I do wrong? I will appreciate any comments.


First, this isn't really a perl problem. An appropriate newsgroup
for such a question would be: comp.infosystems.www.authoring.cgi

Second, browsers do *not* run CGI programs. Browsers request that
the *server* run the CGI program.

Third, you need to get your script installed on a server somewhere,
and then put the URL to that server in your HTML.

Fourth, you should pick up a book about how CGI and the WWW work.
Just go borrow one from your local library.


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 1 Feb 1997 03:04:31 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Multithreadin'
Message-Id: <5cubrv$feq@fridge-nf0.shore.net>

Ray Davis (johnt@laplaza.org) wrote:

: Also, does anybody know why sockets won't open on an IRIX...i've tried and
: tried, but won't open it for some reason.  If so...does anybody know how
: to get around it?

What examples did you use?  From where?  Did you use the Perl 5 sockets
modules?  Please include some code for us to look at - it would be
extremely helpful.

--
Nate Patwardhan | nvp@shore.net
"Lane, this is pure snow!  Do you have any idea what
the street value of this mountain is?"
	--Charles Demar from _Better Off Dead_


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

Date: Sat, 01 Feb 1997 01:29:01 -0500
From: Tim Thayer <thayer@wcax.com>
Subject: NTPERL Serial Port Problem
Message-Id: <32F2E2AD.4AE8@wcax.com>

I am encountering a problem with sending and receiving data from COM1 or
COM2 of a pc running NT4.0, IIS 2.0 and NTPerl build 110 and Perl for
Win32. I can only send data out but it hangs when waiting to receive
data. However after a reboot, I must run a program like windows Terminal
or Hyper terminal to interact with the port, then run my perl script.
Now the writes and reads from the port work just fine, until I reboot
again. I have tried using read/write/sysread/syswrite functions, the
syswrite and write work but both read and sysread fail. My application
involves using a web browser to send commands to a device attached to
the COM port and act on its replies. I am setting up the port with a
system call to the MODE command, which appears to complete OK, followed
by open(COMPORT,"+<COM1:9600,N.8,1");. Any help would be appreciated, I
have worked with Unix flavors of perl, but NTperl is new to me. My NT
install was very basic and the only other thing installed since has been
perl and Access. The COM ports are setup in the control settings as
Default for Address and Default for IRQ. I have tried the port timeout
parameter as well, leaving it set to off. The port can input a complete
text file from an external PC with no missing characters once I have
toggled something using either Hyper terminal or Windows Terminal since
a reboot. Also both COM1 and COM2 seem to behave the same way.

TIA
thayer@wcax.com
Network System Adminstrator
WCAX-TV
Burlington, VT. 05401


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

Date: Fri, 31 Jan 1997 15:20:59 -0500
From: A n e e l <akt1@stern.nyu.edu>
To: Wilson Armour <wmaiv@tyrell.net>
Subject: Re: Password Program Help
Message-Id: <Pine.SUN.3.93.970131150232.3709A-100000@sales.stern.nyu.edu>

I came accross the same proplems quite some time back......
just do a 
chmod 4755 <filename>
where filename is the perl file.

There is just one problem that I have with it......
whenever I make any changes to that perl file the SETUID permission is
lost so I have to again and again (whenever i save a file) do a chmod 4755
to activate the setuid!



On Wed, 18 Dec 1996, Wilson Armour wrote:

> I am setting up a web page that needs a password program on it. I have
> written a perl program that works fine in the shell when I use it but
> not from the browser I need to give the program my rights when run
> from the browser, what I need to do is put it in a c wrapper or use
> setid to make it work my book on perl and the man on perl on my system
> says I can do this but not how can anyone tell me or give me an
> example of a c wrapper?	
> 
> 


 Aneel
________________________________________________________________________
|Aneel Tejwaney	                  |Email: akt1@stern.nyu.edu           |
|  Webmaster                      |	  	  or                   |
|     -- Information Systems Club |	  akt8050@is2.nyu.edu          |
|  WebCoordinator                 |  			       	       |
|     -- Management Society       |URL: http://www.stern.nyu.edu/~akt1 |
========================================================================




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

Date: Fri, 31 Jan 1997 23:14:13 -0700
From: Adam Richards <arichards@postoffice.worldnet.att.net>
Subject: Re: Perl on Microsoft IIS
Message-Id: <32F2DF35.7BF@postoffice.worldnet.att.net>

what is the problem?


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

Date: Fri, 31 Jan 1997 22:41:14 -0600
From: futurecard@netstorage.com
Subject: perl script ouput from html form
Message-Id: <854771407.2331@dejanews.com>

foreach ( @setup_fields )
{
  print MAIL "$_ '$FORM{$_}'\n" ;
}

The above is a section from my perl script that prints field values from 
an html form to a file.  This is within a call to MAIL.  When I receive 
the mail, the format of the data is a column - all the field values go down 
the left side of the page.

I would like to have the fields print out in a long string - one line 
across the page.  I don't care about the length - I need it in this format 
 to feed into a dtat base program.

Any solutions?  I can email anyone the entire perl file if needed.
Thanks.
John Cervini
-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Sat, 01 Feb 1997 04:59:50 GMT
From: matt@callnet.com (Matthew Ahrens)
Subject: perl-mod on apache giving errors
Message-Id: <32f2cccc.110194242@news.alt.net>

I am using perl-mod on Apache v1.2b4, with perl 5.003. It seems that
whenever my perl script that runs through perl-mod exits, (the script seems
to work fine) it logs this message to the error-log:

[Fri Jan 31 23:53:41 1997] httpd: caught SIGSEGV, dumping core

Note: SIGSEGV means 'segment violation', whatever that means

however, I can not find a core dump. I made sure that I am closing the
connection properly with '$c->close;'. I also tried closing the connection
with '$c->close; exit;' but that did not seem to make a difference. 

Please let me know (cc: my email) if you have any idea what is going wrong

thanks,
--matt


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

Date: Sat, 01 Feb 1997 04:02:18 GMT
From: djones@ripco.com (Devin Jones)
Subject: Re: PerlScript (was Re: Heard rumor of MS Perl!!)
Message-Id: <32f3be3d.15413921@news.ripco.com>

Thomas Winzig <tsw@pvo.com> wrote:

>As for *why* anyone but a perl purist would want it ... errm, well it
>might be a better question to ask why you *wouldn't* want it! Seeing
>as how most of the stuff dealing with web pages is text parsing and
>file I/O, PerlScript fits the bill quite nicely. 
>
>I just wish ActiveWare would release some more documentation on it...
>
>-thomas

I was really impressed with PerScript, but I wouldn't touch MS-IIS
with a ten foot pole, so I wrote a quick CGI to run PerlScript .asp
files. I'll turn this into a module and add some of the objects and
methods that ActiveWare's ISAPI dll provides. Then I'll write it as a
Netscape Server extension.


#!/opt/bin/perl

# p-script.cgi
# Description
# convert specified .asp file to perl code and eval into html on fly
#
# Jan 31 1997 created by Devin Jones
#

use CGI; 
$form=new CGI; 
print $form->header;

# look for <% ... %> macros and respond accordingly
# <%@ ... %> =>  
# <%=(.*) %> => $1 
# <% (.*) %> => \nEOF\n $1 print <<EOF;\n 

unless( eval_asp("/home/djones/asp" . $form->path_info()) ) {
    print "got problem with " . $form->path_info() . " $@" ;
} 

sub eval_asp {
    my($file)=shift;
    local(*IN);

    open(IN,$file) or print("Cant open $file");
    
    $big = join("",<IN>);

    $big =~ s/<%@.*?%>//sg;
    $big =~ s/<%=(.*?)%>/$1/sg;
    $big =~ s/<%(.*?)%>/
EOF
	    $1 print <<EOF;
    /sg ;

    $big .= "\nEOF\n";
    eval("print <<EOF;$big");
}




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

Date: Fri, 31 Jan 1997 23:14:56 -0600
From: dave@okvalley.com
Subject: Re: Script Timing Out
Message-Id: <854772395.2795@dejanews.com>

> > I wrote a file search script to be able to search through the dirs
> > on my server and find files.. ie find all files that contain .cgi
> > 
> > Works great, the only problem is, when it has alot of files to deal
> > with, it prints the header, or nothing at all, and netscape times
> > out waiting for the script.. I've tryed a few things here like sending
> > a html status message for every 1000 files searched, but no luck...
> > 
> > Anybody have any ideas???
> 
> Sigh. How is it so many people fail to understand the need to post
> their script in order to get help? Is it possible that they're
> concerned others might steal their extraordinary code?

I thought it might be somewhat of a generic problem..
Take a look..  http://www.okvalley.com/edis/webdir/webdir.cgi.txt

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


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

Date: Fri, 31 Jan 1997 23:14:20 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Syntax error
Message-Id: <cfjuc5.sh4.ln@localhost>

Ralph Allan Rice (rrice@rex.imperium.net) wrote:
: I wonder if anyone has any suggestions on this....

: I have a perl script that is 209 lines long.  When testing on a UNIX
: server, I get a "Syntax Error, line 210, at EOF" message.  The problem
: is that there IS no line 210. So what does this error mean?  The only
: logical idea I can think of is that I originally started to write this
: program in the MS-DOS editor, uploaded it to the Unix server, and tryed
                                ^^^^^^^^^^^

If you use ASCII transfer mode in ftp it should do The Right Thing
with the line endings.

Though line endings are not likely to be related to your 
particular problem described above.

Other followups have addressed that what _is_ the likely cause.


: to use the VI editor to edit certain lines.  I remember a few weeks back
: reading that UNIX and DOS end their respective text files with different
: characters ("the EOF character(s)") My question is that if Perl
: recognizes certain specific EOF characters to end Perl files, how can I
: get rid of the "syntax error" without retyping the entire script in the
: VI editor??


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Fri, 31 Jan 1997 14:05:29 -0500
From: A n e e l <akt1@stern.nyu.edu>
Subject: The excape character sequence
Message-Id: <Pine.SUN.3.93.970131135910.25574A-100000@sales.stern.nyu.edu>

I am writing a program for unix in perl but I don't want people to be albe
to excape out of the program without finishing the program first!  They
should not be able to hit the control C and other such keys to bypass or
exit the program like that!

And is there a way that I could make this into a binary executable (I
don't want it too be readable)!

Thanks,
 Aneel
akt1@stern.nyu.edu




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

Date: 1 Feb 1997 03:02:07 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: uuencoding
Message-Id: <5cubnf$feq@fridge-nf0.shore.net>

Matteo Pelati (pelatimtt@poboxes.com) wrote:
: Does anyone know how to uuencode/decode to read and write the .htpasswd 
: file on a server?

???

I think you're referring to crypt() which is the encrypted password
you're seeing in the .htpasswd file.  Perl has a crypt() function that
is (fully) documented in the manpages, but here's a snippet:

$string = 'mynameis'; ### clear text password
$salt = 'saltisbadforyou'; ### salt - word which string is encrypted against

$encstring = crypt($string, $salt); ### now encrypt the string
print("$encstring\n"); ### should output the encrypted string.

HTH!

--
Nate Patwardhan | nvp@shore.net
"Lane, this is pure snow!  Do you have any idea what
the street value of this mountain is?"
	--Charles Demar from _Better Off Dead_


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

Date: Sat, 01 Feb 1997 03:16:10 GMT
From: rgerharz@erols.com (Reinhold J. Gerharz)
Subject: Re: Why I think so (Re: "-i" switch is unsafe!)
Message-Id: <32f2b3ee.2352893@news.erols.com>

hv@crypt.compulink.co.uk (Hugo van der Sanden) wrote:

>Reinhold J. Gerharz (rgerharz@erols.com) pontificated:
	...
>:4) Assumption: Successful programmers do not give their users programs
>:that make it easier to lose data files.
>[...]
>:In UN*X, this call replaces an existing file of the same name.
>Perl mimics, derives from and celebrates the Unix paradigm. It revels in
>it. Unix systems have system administrators. if you are not qualified to
>handle the concept of Unix file replacement (as resonantly echoed in
>perl), your system administrator should never have let you use perl
>(nor 'mv', nor 'cp', and certainly not 'rm').

Again, I point out that I am not targetting UNIX hosted clients. Are
you saying Perl is reserved for UNIX? Every indication is that Perl is
_portable_.

You presume too much, me thinks.


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

Date: Fri, 31 Jan 1997 14:59:32 -0500
From: A n e e l  <akt1@stern.nyu.edu>
To: Charles Peri <charles_peri@ccm.fm.intel.com>
Subject: Re: Win32:Service::StartService Problem !
Message-Id: <Pine.SUN.3.93.970131145254.1927A-100000@sales.stern.nyu.edu>

Hello All....

It seems that you are using a windows platform....
I am trying to make the transition from unix to windows 95 but I don't
know the commands that are windows specific ....
I What I am trying to do is to have a  few gifs basically scroll on my PC
without launching another application... even scrolling test is fine but I
would rather have scrolling gifs or any other immage format

Are there any books on windows and PERL out there?  I didn't find any at
Barnes and Nobles


On Tue, 17 Dec 1996, Charles Peri wrote:


> Hi,
>    I am trying to stop and restart the IIS server through a 
> cgi-bin script. The main section of the code is given below:
> 
>     $service = "W3SVC" ;
>     Win32::Service::StopService("",$service);
>     sleep 2 ;
>     Win32::Service::StartService("",$service);
> 
> 
> The problem is, the service stops but does not restart. I don't get
> any error message. When I run the code from Dos Prompt, it is running
> fine. I tried increasing the sleep, but that did not help. Can anyone
> help me in the above situation ?
> 
> 
> Many thanks,
> 	Charles Peri
> 
> 


 Aneel
________________________________________________________________________
|Aneel Tejwaney	                  |Email: akt1@stern.nyu.edu           |
|  Webmaster                      |	  	  or                   |
|     -- Information Systems Club |	  akt8050@is2.nyu.edu          |
|  WebCoordinator                 |  			       	       |
|     -- Management Society       |URL: http://www.stern.nyu.edu/~akt1 |
========================================================================



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

Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Jan 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.

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 V7 Issue 877
*************************************

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