[7643] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1269 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 4 10:17:25 1997

Date: Tue, 4 Nov 97 07:00:27 -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           Tue, 4 Nov 1997     Volume: 8 Number: 1269

Today's topics:
     Re: @ARGV Limits or Attempts to avoid "glob: Too many a <markm@nortel.ca>
     AUTOLOAD DESTORY method not found <tw36027@glaxowellcome.com>
     Re: AutoLoad error using odbc.pm <cornelio@home.com>
     CGI / Reflection Web Server (John Desper)
     Re: Combining two files into a two-column file (Honza Pazdziora)
     Re: Combining two files into a two-column file <rra@stanford.edu>
     Re: counting lines in a file?? (Pete Barker)
     Re: emulating lockf(3) with fcntl <qdtcall@esb.ericsson.se>
     Re: File globbing 5.004.01/2 on Win32 <chris_ns@searle1.demon.co.uk>
     Re: gethostbyaddr <markm@nortel.ca>
     How do I test my Perl <147107@swansea.ac.uk>
     Re: How do I test my Perl <tw36027@glaxowellcome.com>
     Re: OLE, ADODB, can't call EOF()!? help... <cornelio@home.com>
     Re: Perl Assignment!! (Tad McClellan)
     Re: perl script memory leak (Keith Willis)
     Re: Personal Web Server - Perl ? (John Desper)
     Precedence problem? wwilliam@cisco.com
     Re: Precedence problem? (Mike Heins)
     Re: problem with Win32::ODBC <cornelio@home.com>
     PROBLEM WRITING FILES - HELP! <vidals@etica-entertainment.com>
     Re: PROBLEM WRITING FILES - HELP! (Jim Michael)
     Redirection to a password protected file? <miran.sepic4@mss.tel.hr>
     Re: Redirection to a password protected file? (Jeremy D. Zawodny)
     Re: running remote shelll under suid perl script ? <markm@nortel.ca>
     Re: Simple console program (Pete Barker)
     Re: slow server (Honza Pazdziora)
     Sys::Syslog not working on Linux (Andreas Steffan)
     Re: Sys::Syslog not working on Linux (Mike Stok)
     Re: transpose file (Eric Bohlman)
     Where the HECK do you get blat <josh@jersey.net>
     Re: Where the HECK do you get blat (Mike Stok)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 04 Nov 1997 03:00:17 -0500
From: Mark Mielke <markm@nortel.ca>
Subject: Re: @ARGV Limits or Attempts to avoid "glob: Too many arguments" message
Message-Id: <lq1ra8xhywe.fsf@bmerhe83.nortel.ca>

tadmc@flash.net (Tad McClellan) writes:

> gshibona@unconfigured.xvnews.domain wrote:
> : I created two "do nothing" scripts; a while and a for, each operating on
> : script command line input i.e. @ARGV.
> : --------------------------------------------------------
> : #! /usr/local2/bin/perl
> : # this one is called wtst
> : while ( $file = <@ARGV> ) {
>                   ^^^^^^^
> This is very likely not doing what you think it is doing.
> What did you want to do here?
> It is in no way synonymous with the foreach() version below.
> Matter of fact, I can't even figure out what perl really does
> do here. A big filename glob(), I guess?

I just tried it and it seems that:

     wtst a\* b\* c\* d

given a directory containing:

      aa, ab, ba, bb, ca, cb, da, db

would in the while loop condition return once for each of:

     aa, ab, ba, bb, ca, cb, d

> : {major:31 /users/mofp1.0.02}ll | wc -l
>                               ^^
> I don't think that is a standard Unix command.
> What does it do?

On hpux it does ls -l (it's a hardlink to ls(1))

> You might also have a look at this Frequently Asked Question:
>    "Why do I sometimes get an "Argument list too long" when I use <*>?"

I think this is likely the problem.

So the answer is, use "grep { ... } readdir()" or the mentioned xargs,
depending where it fits best.

--                                                  _________________________
 .  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | Northern Telecom Ltd. |
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | Box 3511, Station 'C' |
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, ON    K1Y 4H7 |
  markm@nortel.ca  /  al278@freenet.carleton.ca     |_______________________|


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

Date: Tue, 04 Nov 1997 08:42:15 -0500
From: Thad Welch <tw36027@glaxowellcome.com>
Subject: AUTOLOAD DESTORY method not found
Message-Id: <345F2637.F62C6A3A@glaxowellcome.com>

Hello,

I'm using the AUTOLOAD method for a class.  The DESTORY method is being
trapped by this method. Is this normal? If not any ideas?

Thanks,
Thad



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

Date: Tue, 04 Nov 1997 00:11:52 -0800
From: Michael Cornelio <cornelio@home.com>
To: Cornelius Griffin <Escrubb@att.net>
Subject: Re: AutoLoad error using odbc.pm
Message-Id: <345ED8C8.C0B160E9@home.com>

This error usually occurs when you call a routine that
is not defined in a particular module, and the module
contains an AUTOLOAD method.

Make sure you are calling a defined routine in the ODBC.pm module ...
For example: are you calling Fetch or FetchRow? If you call
Fetch instead of FetchRow, you will receive this error since
Fetch is not defined in ODBC.pm

Hope this helps ...

-- Mike Cornelio

Cornelius Griffin wrote:
> 
>         When using odbc.pm and the required drivers to access information
> in an oracle database, I receive the error "Goto undefined subroutine
> &AutoLoader::AUTOLOAD at c:\perl.... line 861".
>         The error occurs after the information has been successfully
> retrieved.
>         Can anyone point me in the right direction to determine where I
> may further check my configuration? or where I can find more information
> on the AutoLoad functionality? Using NT4, Win32Perl build 307, updated
> odbc.pll.
>         BTW, the error doesn't occur on 95 with the same configuration.
> 
> Thank you.
> 
> Cornelius

-- 
---------------------------------------------------
Michael Cornelio
cornelio@home.com


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

Date: 1 Nov 1997 23:47:42 GMT
From: John.M.Desper@vanderbilt.edu (John Desper)
Subject: CGI / Reflection Web Server
Message-Id: <63gf2u$1b4$2@news.vanderbilt.edu>

Help!
Has anyone out there been able to run CGI scripts on a WRQ Reflection Web 
Server? (platform = Windows 95) Documentation is thin and technical support is 
slow. It will run .exe and .bat files (and .pl files wrapped in .bat files, for 
that matter) but will not even include .pl files in a directory listing.
If anyone has had success, I'd appreciate hearing from you.
-John Desper



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

Date: Tue, 4 Nov 1997 07:34:46 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Combining two files into a two-column file
Message-Id: <adelton.878628886@aisa.fi.muni.cz>

kluge@fujitsu.com.au (Steffen Kluge) writes:


> Cheers perl-divers!
> 
> I thought I gradually translate my trusty collection of awk and
> sed scripts into perl and came across the following problem:
> 
> When combining two text files side-to-side in order to produce a
> two-column file I'm usually using something along the lines of:
> 
> awk '{printf "%s", $0; getline < F2; printf " %s\n", $0}' F2=f2.txt f1.txt
> 
> Now, I tried a2p which actually produced working perl code from the
> above! However, the script produced is more than 25 lines long...
> 
> I'm wondering whether I overlooked the obvious, and there is some
> one-liner for doing this in perl, too.

I've got longer oneliner:

perl -e 'open FIRST, shift or die; open OTHER, shift or die; while (defined($l1 = <FIRST>) and defined($l2 = <OTHER>)) { chomp $l1; print $l1, " ", $l2; }' x1 x2

Hope this helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: 04 Nov 1997 00:44:17 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Combining two files into a two-column file
Message-Id: <m3zpnl82vy.fsf@windlord.Stanford.EDU>

Steffen Kluge <kluge@fujitsu.com.au> writes:

> When combining two text files side-to-side in order to produce a
> two-column file I'm usually using something along the lines of:

> awk '{printf "%s", $0; getline < F2; printf " %s\n", $0}' F2=f2.txt f1.txt

The equivalent in Perl would be something like:

perl -pe 'BEGIN {open (F2, "f2.txt")} chomp; print "$_ " . <F2> . "\n"' f1.txt

-- 
#!/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: 4 Nov 1997 10:09:24 GMT
From: on.maps.barker@cix.co.uk (Pete Barker)
Subject: Re: counting lines in a file??
Message-Id: <memo.19971104100810.137A@mt.cix.co.uk>

In article <63j39h$naa$1@bashir.ici.net>, burt@ici.net (Burt
Lewis) wrote:

> Hi,
>
> I think this is an easy one but once again, I'm having trouble.
>
> I have a text file that looks something like:
>
> red 22222 green blue black
> black 22222 black blue green
> white 33333 blue green black
> red 33333 green black blue
> aqua 33333 black blue white
> blue 44444 red green blue
>
> I need to subtotal by the second column so that my results are
simply:
>
> 22222 group has 2 lines
> 33333 group has 3 lines
> 44444 group has 1 line
>
>
> Appreciate any help with this.
>
> Thanks!
> Burt Lewis
> burt@ici.net
>
>

while(<>)
{
	($crap,$num,$rest) = split(/ /);
	next if $_ eq "\n";
	$accum{$num}++;
}

for $val (sort keys %accum)
{
	print "\n$val group has $accum{$val} lines";
}

Pete Barker
P.S. Please remove on.maps. to mail me.



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

Date: 04 Nov 1997 09:04:08 +0100
From: Calle Dybedahl <qdtcall@esb.ericsson.se>
Subject: Re: emulating lockf(3) with fcntl
Message-Id: <isbu01rsp3.fsf@godzilla.kiere.ericsson.se>

Rebecca Griffin <griffin@ccis.adisys.com.au> writes:

> I am trying to lock a file on a hp-ux machine (hence cannot use flock),
> and according to "Programming Perl" 2nd Edition - page 166, I can use
> fcntl to emulate lockf(3).

This has been improved in later versions of Perl. From perlfunc:

     flock FILEHANDLE,OPERATION
             Calls flock(2), or an emulation of it, on
             FILEHANDLE.  Returns TRUE for success, FALSE on
             failure.  Produces a fatal error if used on a
             machine that doesn't implement flock(2), fcntl(2)
             locking, or lockf(3).  flock() is Perl's portable
             file locking interface, although it locks only
             entire files, not records.
 
-- 
		    Calle Dybedahl, UNIX Sysadmin
       qdtcall@esavionics.se  http://www.lysator.liu.se/~calle/


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

Date: Tue, 04 Nov 1997 09:32:13 GMT
From: "Chris Searle" <chris_ns@searle1.demon.co.uk>
Subject: Re: File globbing 5.004.01/2 on Win32
Message-Id: <01bce904$4afa7440$ae004589@edc036>

Thanks.

Works on both my NT and 95 installations.

If no parameters are supplied then it tended to terminate with:

Wild.pm did not return a true value.
BEGIN failed--compilation aborted.

Just added a 1; as the last line so it always returns a true value.

> From an article posted by Gurusamy Sarathy a while back:
> 
> Set PERL5OPT in your environment to "-MWild" (or append, if you already
> have something in PERL5OPT), and make sure you put Wild.pm below in your
> perl's "lib" directory: 
> 
> # Wild.pm - emulate shell @ARGV expansion on shells that don't
> use File::DosGlob; 
> @ARGV = map { my @g = File::DosGlob::glob($_) if /[*?]/; @g?@g:$_ }
@ARGV; 
> 


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

Date: 04 Nov 1997 03:11:41 -0500
From: Mark Mielke <markm@nortel.ca>
Subject: Re: gethostbyaddr
Message-Id: <lq1pvohhyde.fsf@bmerhe83.nortel.ca>

"U-Topia S.r.l." <root@u-topia.com> writes:

> Hi ,
> i have this problem...
> i have to fetch a page. i use gethostbyname and it work fine.
> but if i use a numerical address (like 190.190.2.2) i cannot resolve it.
> 

You could try this:

   use Socket;

   $hostname = "1.2.3.4";
   $port = "http";

   if ($port =~ /\D/) {
      $port = getservbyname($port, 'tcp') ||
         die "Service could not be resolved: $port\n";
   }

   $addr = inet_aton($hostname) ||
      die "Hostname could not be resolved: $hostname\n";

It's in "man perlipc" and several other places.

mark

--                                                  _________________________
 .  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | Northern Telecom Ltd. |
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | Box 3511, Station 'C' |
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, ON    K1Y 4H7 |
  markm@nortel.ca  /  al278@freenet.carleton.ca     |_______________________|


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

Date: Tue, 04 Nov 1997 10:25:33 -0800
From: Jason Deabill <147107@swansea.ac.uk>
Subject: How do I test my Perl
Message-Id: <345F689D.25D6@swansea.ac.uk>

I am about to write my first Perl script. I want it to run as a CGI 
script on a UNIX server. However I only have access to a windows 3.1 
OS and don't know how to go about testing my script to ensure it will 
run when I upload it. Can someone please help me??


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

Date: Tue, 04 Nov 1997 09:00:07 -0500
From: Thad Welch <tw36027@glaxowellcome.com>
To: jason@students.org.uk
Subject: Re: How do I test my Perl
Message-Id: <345F2A67.E9D634DD@glaxowellcome.com>



Jason Deabill wrote:

> I am about to write my first Perl script. I want it to run as a CGI
> script on a UNIX server. However I only have access to a windows 3.1
> OS and don't know how to go about testing my script to ensure it will
> run when I upload it. Can someone please help me??

The easiest solution is to get some light-weight web server for windows
3.1.
I guess you already thought of that.

You could execute your perl script and capture its stdout to a file and
try
opening that file in a browser.  Assuming you are using the CGI perl
module,
you could simulate the action of pressing the web form submit button by
manually assigning html fields value.
For example,
$query = new CGI(  { 'field1value' =>'data1' } );

Hope this helps,
Thad




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

Date: Tue, 04 Nov 1997 00:09:11 -0800
From: Michael Cornelio <cornelio@home.com>
To: Wesley <wkc@amanda.dorsai.org>
Subject: Re: OLE, ADODB, can't call EOF()!? help...
Message-Id: <345ED827.7B269A32@home.com>

Hi Wesley,

I usually something like ...

   $Conn = $Server->CreateObject("ADODB.Connection");
   $Conn->Open( "myODBC" );
   $sql = "select * from myTable";
   $RS = $Conn->Execute($sql);

It looks like your $RS = ... statement is failing ...
That is, it is not returning a valid $RS object,
hence the $RS->EOF method call fails ...
Check to make sure that your DataSourceName is valid.

-- Mike Cornelio

Wesley wrote:
> 
> I got an error msg:  Can't call method "EOF" without a package or object
> reference at db.pl line 7.
> 
> The program db.pl:
> 
> use OLE;
> $conn = CreateObject OLE "ADODB.Connection" ||
>   die "CreateObject: $!";
> $conn->Open("myODBC","myID","myPassword");
> $sql = "select * from myTable";
> $RS = $conn->Execute($sql);
> while(!$RS->EOF()) {
>         for ( $i = 0; $i < $RS->Fields->Count; $i++ ) {
>                 print $RS->Fields($i)->value
>                 }
>         $RS->MoveNext;
>         }
> 
> Pls heeelp...
> 
> Please email me at wkc@cetus.net
> 
> Thanks
> 
> Wesley

-- 
---------------------------------------------------
Michael Cornelio
cornelio@home.com


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

Date: Tue, 4 Nov 1997 06:37:47 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Perl Assignment!!
Message-Id: <ru4n36.om.ln@localhost>

Andrea Miller (andee@hcpd.com) wrote:
: Hello!!!  I am working on a Perl Lab assignment that is due in my OS
: Interface class here at DSU here in Madison,SD.  However, I am having
: some difficulties with the assignment.  For the assignment we have to
: write a perl language beautifying application that will take a text file
: and do the following:


In addition to looking up the stuff that Brian suggested, you might
also want to have a look at this Frequently Asked Question, part 5:

   "How do I change one line in a file/delete a line in a file/insert 
    a line in the middle of a file/append to the beginning of a file?"


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: Tue, 4 Nov 1997 10:35:32 GMT
From: keith_willis.junk@non-hp-unitedkingdom-om1.om.hp.com (Keith Willis)
Subject: Re: perl script memory leak
Message-Id: <3460f9cf.691883225@elf.bri.hp.com>

On 29 Oct 1997 15:17:16 GMT, jgloudon@bbn.remove.com (Jason Gloudon)
wrote:

>Mike Heins (mheins@prairienet.org) wrote:
>: Keith Willis (keith_willis.junk@non-hp-unitedkingdom-om1.om.hp.com) wrote:
>: : 
>: : I have this fairly noddy little script which repeatedly connects to a
>: : daemon, sends it a command, and displays the returned text in a curses
>: : window.  When it's running, it very gradually leaks memory, and if I
>
>: Perhaps never undefining your objects and letting them go out of scope?
>$sock = IO::Socket::INET->new(PeerAddr => $ENV{'MYDAEMON_HOST'},
>                                PeerPort => $ENV{'MYDAEMON_PORT'},
>                                Proto    => 'tcp')|| die "socket: $!";
>
>Were you referring to this ? I believe that by replacing sock with a new
>reference the reference to previous object that all references to the old
>object should have gone away, and it should be marked for desctruction.

As an update to this, I have just upgraded to the 5.004_04 maintenance
release, and the leak has gone away.  Looking in the announcement
article, I find:

BUG FIXES

  Major memory growth bug fixed. (Worth upgrading for this alone.)
  Fixed gaps in tainting (readdir, readlink, gecos, bit vector ops).
  Object destruction is more timely and orderly.
  DB_File now sub-classable (and other fixes).
  Fixed memory leak in splice(@_).
  Fixed debugger core dumps.

----------------------------------------------------------------------
The above message reflects my own views, not those of Hewlett Packard.
When emailing me, please note that there is no '.junk' in my address.


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

Date: 1 Nov 1997 23:27:00 GMT
From: John.M.Desper@vanderbilt.edu (John Desper)
Subject: Re: Personal Web Server - Perl ?
Message-Id: <63gds4$1b4$1@news.vanderbilt.edu>

In article <3458ba3f.0@news.bru.tfi.be>, yooo@geocities.com says...
>
>Is it possible to configure Personal Web Server (Microsoft), so I can run
>Perl CGI-scripts on it ?
>
>Thx in advance
>
>
I'm new at it, and I may miss a step (I tend to do things and forget what it 
was that I did that got things to work):
(don't enter the quotes!)
(1) Associate .pl files (or .cgi) with Perl. Try from Explorer:
View--Options--File Types--New Type.
Description "Perl" (or whatever...it's unimportant)
Associated extension "pl" (or cgi)
Content type (MIME) I haven't put anything in & it seems unimportant
Then for Actions:
click New; action "OPEN"; application used..."C:\perl\bin\perl.exe %1 %*"
(If you've done this right, double-clicking on the script in Explorer will run 
the script.)
There are some registry entries that you'll need to make for Perl but I suspect 
you've gotten that far if you've gotten Perl to work.
Then it's a matter of opening up the Administration feature of the Personal Web 
Server, which is all done thru your browser. Add a directory entry for 
C:\CGI-BIN\ (or whatever) and (this is the key) give it Read and Execute 
access.
This *ought* to work.
Also check out:
http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html
There seems to be little documentation for the PWS, but seems that people try 
stuff that works for the commercial Internet Information Server, and that seems 
to work for PWS as well.



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

Date: Tue, 04 Nov 1997 08:22:07 -0600
From: wwilliam@cisco.com
To: wwilliam@cisco.com
Subject: Precedence problem?
Message-Id: <878653182.259@dejanews.com>

Can anyone find the logic or precedence error in the following:

# get user's login name
$login = ((getpwuid($<))[0] ||
    defined($ENV{'USER'}) ? $ENV{'USER'} :
    (defined($ENV{'LOGNAME'}) ? $ENV{'LOGNAME'} :
    "Anonymous"));

It was written by a Perl programmer much better than me and looks like it
should work, but doesn't.

As the script runs:
(getpwuid($<))[0] returns the correct user name
$ENV{'USER'} is undefined
$ENV{'LOGNAME'} returns the correct user name

The result is, $login is set to nothing.  I suspect that's because
somehow the value of $ENV{'USER'} is somehow getting returned, but I'm
not sure how.

Obviously, the desired result is for it to put the result of
(getpwuid($<))[0] into $login if defined (which it is), or failing that,
the result of $ENV{'LOGNAME'}.

Anyone got any ideas?

Wade
wwilliam@cisco.com

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


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

Date: 4 Nov 1997 14:47:23 GMT
From: mheins@prairienet.org (Mike Heins)
Subject: Re: Precedence problem?
Message-Id: <63nchr$9ia$2@vixen.cso.uiuc.edu>

wwilliam@cisco.com wrote:
: Can anyone find the logic or precedence error in the following:
: 
: # get user's login name
: $login = ((getpwuid($<))[0] ||
:     defined($ENV{'USER'}) ? $ENV{'USER'} :
:     (defined($ENV{'LOGNAME'}) ? $ENV{'LOGNAME'} :
:     "Anonymous"));
: 
: It was written by a Perl programmer much better than me and looks like it
: should work, but doesn't.

They aren't better at writing readable code. 8-)

Would you really ever want to set $login to the empty string? That
is what will happen here if the environment variable is set but empty.

How about a simple:

$login = (getpwuid($<))[0] || $ENV{USER} || $ENV{LOGNAME} || 'Anonymous';

--
Regards,
Mike Heins

This post reflects the
opinion of my employer.



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

Date: Mon, 03 Nov 1997 23:54:35 -0800
From: Michael Cornelio <cornelio@home.com>
To: Scott Allaire <allaires@ctcdist.com>
Subject: Re: problem with Win32::ODBC
Message-Id: <345ED4BB.B5AA624@home.com>

I believe it's failing because the line
$Db = new Win32::ODBC(DATASOURCE)
contains an undefined DATASOURCE.
Replace DATASOURCE with a valid datasource name (a string).
The statement $Db->Sql($SqlStatement) fails because
$Db is undefined since the "new" statement failed.

Hope this helps ...

Mike Cornelio

Scott Allaire wrote:
> 
> I am having a problem with the following code.  I get the error
> 
> Can't call method "Sql" without a package or object reference.
> 
> use Win32::ODBC;
> $Db = new Win32::ODBC(DATASOURCE);
> $SqlStatement = "SELECT * FROM table";
> if ($Db->Sql($SqlStatement)) {
>      while ($Db->FetchRow()) {
>           ($field1, $field2) = $Db->Data("field1", "field2");
>           print "$poitno, $name";
>      }
> }
> else {
>     print "SQL failed.\n";
>     print "Error: " . $db->Error() . "\n";
> }
> $Db->Close();
> 
> Thanks for any help in advance.
> allaires@ctcdist.com

-- 
---------------------------------------------------
Michael Cornelio
cornelio@home.com


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

Date: Mon, 03 Nov 1997 23:38:30 -0800
From: Gil Vidals <vidals@etica-entertainment.com>
Subject: PROBLEM WRITING FILES - HELP!
Message-Id: <345ED0F6.6BE31943@etica-entertainment.com>

This is driving me CRAZY!!!!

I've written a small program that writes to a file in the directory
"/tmp2". The directory
look like this:

   drwxrwxrwx  2 root root 1024 Nov 3 23:05 tmp2

The program is:

   #!/usr/bin/perl

   open FILE, ">>/tmp2/test20" || die "cannot open file";
   print FILE "this is a test\n";
   close (FILE);


The problem is that it ***ONLY*** writes to the file when I'm logged in
as the root.
I need this to work for other users with less power than the root! When
I log in as
"webuser" or "pwrusr", the program successfully creates the file but
DOES NOT write to it.

The empty file looks like:

    -rw-r--r-- 1 pwrusr wheel 0 Nov 3 23:27 test20



I tried the following code which, again, ONLY works when logged as the
root:

   #!usr/bin/perl

   use FileHandle;
   $fh = new FileHandle "/tmp2/test21", O_RDWR|O_CREAT, 0777;
   if (defined $fh) {
      print "defined\n";
      print $fh "test\n";
      undef $fh;
   } else {
       print "undefined\n";
   }

The empty :-( file created in this case looks like:

   -rwxr-xr-x 1 pwrusr wheel 0 Nov 3 23:40 test21

If I could only create a file with rwx permissions, my problems would
be resolved.
Anyway, I'm new to LINUX and PERL, so there must be something incredibly
obvious that I am
oblivious too. Any help would be greatly appreciated!


Thanks,
Gil




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

Date: Tue, 4 Nov 1997 12:42:11 GMT
From: genepool@netcom.com (Jim Michael)
Subject: Re: PROBLEM WRITING FILES - HELP!
Message-Id: <genepoolEJ4GMC.Kpq@netcom.com>

Gil Vidals (vidals@etica-entertainment.com) wrote:
: "/tmp2". The directory
: look like this:
:    drwxrwxrwx  2 root root 1024 Nov 3 23:05 tmp2

: The problem is that it ***ONLY*** writes to the file when I'm logged in
: as the root.

:     -rw-r--r-- 1 pwrusr wheel 0 Nov 3 23:27 test20

Oops, only root has write permission. You need the chmod command. See the 
chmod man page: man chmod.

Cheers,

Jim


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

Date: 4 Nov 1997 13:43:01 GMT
From: "Miran Sepic" <miran.sepic4@mss.tel.hr>
Subject: Redirection to a password protected file?
Message-Id: <01bce927$9193cc30$7a02a8c0@pc_miran>

How can I redirect from one web page to the file in the /ftproot (Win NT
IIS) directory which doesn't allow anonymous access?

Is It possible, and how, sending the username and password information in
Location request header?


Thanks, Miran


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

Date: Tue, 04 Nov 1997 14:28:04 GMT
From: zawodny@hou.moc.com (Jeremy D. Zawodny)
Subject: Re: Redirection to a password protected file?
Message-Id: <345f30b4.83016120@igate.hst.moc.com>

[cc'd automagically to original author]

On 4 Nov 1997 13:43:01 GMT, "Miran Sepic" <miran.sepic4@mss.tel.hr>
wrote:

>How can I redirect from one web page to the file in the /ftproot (Win NT
>IIS) directory which doesn't allow anonymous access?
>
>Is It possible, and how, sending the username and password information in
>Location request header?

Sounds like you're looking for a Perl script that can redirect
browsers, right?

Using CGI.pm, it can be done in just a few lines of code thanks to
CGI.pm's redirect() method.

Pick up a copy at your local CPAN mirror today. :-)

Jeremy
-- 
Jeremy Zawodny
Internet Technology Group
Information Technology Services
Marathon Oil Company, Findlay Ohio

http://www.marathon.com/

Unless explicitly stated, these are my opinions only--not those of my employer.


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

Date: 04 Nov 1997 03:16:05 -0500
From: Mark Mielke <markm@nortel.ca>
Subject: Re: running remote shelll under suid perl script ?
Message-Id: <lq1oh41hy62.fsf@bmerhe83.nortel.ca>

comdog@computerdog.com (brian d foy) writes:

> In article <345E9C65.5A7B223B@nectar.com.au>, Justin Wills <justin@nectar.com.au> wrote:
> >try %ENV{'PATH'}
> okay.
>    #!/usr/bin/perl -w
>    %ENV{'PATH'} = '/dev/null';
>    __END__
>    # Can't use subscript on hash deref, near "'PATH'}"
>    # (Did you mean $ or @ instead of %?)
>    # Execution of x aborted due to compilation errors.
> 
> darn.  i thought i was going to do something cool! ;)

You could try using $ENV{PATH}... :-) (as opposed to %ENV{PATH})
This _is_ included in the error. (Did you mean $ or @ instead of %?)

hope this helps,
mark

--                                                  _________________________
 .  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | Northern Telecom Ltd. |
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | Box 3511, Station 'C' |
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, ON    K1Y 4H7 |
  markm@nortel.ca  /  al278@freenet.carleton.ca     |_______________________|


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

Date: 4 Nov 1997 14:10:14 GMT
From: on.maps.barker@cix.co.uk (Pete Barker)
Subject: Re: Simple console program
Message-Id: <memo.19971104140900.67A@mt.cix.co.uk>

In article <63jbe2$5o1@bgtnsc03.worldnet.att.net>,
BBDOG@worldnet.att.net (Al) wrote:

>   Can someone please send me a sample perl source code for a DOS
console
> program that says "Hello!".  I want to compare different
programming
> languages.  Email to BBDog@worldnet.att.net.
>
>

You can't compare different programming languages just from
something that says "Hello!"? Some programming languages are
better at things than others, and it therefore depends on what you
want to do!

Anyway, its...

print "Hello!";

Pete Barker
P.S. Please remove on.maps. to mail me.



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

Date: Tue, 4 Nov 1997 07:25:58 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: slow server
Message-Id: <adelton.878628358@aisa.fi.muni.cz>

TFaith <tfaith@NOSPAMaye.net> writes:

> I have a very slow server. I have a cgi that sends e-mail to everyone in
> an array and it takes a few minutes. Is it possible to print out to the
> user a "Thanks, everything worked fine" message while the program is
> still busy e-mailing?

Yes, it is. Just print it. And close the outputs, so that the http
daemon knows you are finished.

Hope this helps,

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: 4 Nov 1997 14:55:52 -0000
From: deas@dont.spam.me.rrz.uni-hamburg.de (Andreas Steffan)
Subject: Sys::Syslog not working on Linux
Message-Id: <63nd1o$7aa$1@mortimer.deas.org>

Hi

I was just playing with the Sys::Syslog module, and I can't get it to
work.
I tried the examples from the manpage, and the program exits without
doing anything. Nothing really happens. It does not even make a
diffrence if syslogd is running or not.

#!/usr/bin/perl
use Sys::Syslog;
syslog('debug', 'this is a test') or print "Error\n";

Any ideas ?
-- 

		       
                           Regards Andreas

PS: Perl-5.004, Linux-2.0.31
PPS: Please also reply via email.

Remove the 'dont.spam.me.' from my adress when replying via mail.
+-----------------------------------------------------------------+
| Andreas Steffan                   email: deas@rrz.uni-hamburg.de|
| Hamburg, Germany                                                |
+-----------------------------------------------------------------+
finger p25a003@server2.rrz.uni-hamburg.de for PGP-public-key.


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

Date: 4 Nov 1997 14:39:46 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Sys::Syslog not working on Linux
Message-Id: <63nc3i$ojr@news-central.tiac.net>

In article <63nd1o$7aa$1@mortimer.deas.org>,
Andreas Steffan <deas@dont.spam.me.rrz.uni-hamburg.de> wrote:

>I was just playing with the Sys::Syslog module, and I can't get it to
>work.
>I tried the examples from the manpage, and the program exits without
>doing anything. Nothing really happens. It does not even make a
>diffrence if syslogd is running or not.
>
>#!/usr/bin/perl
>use Sys::Syslog;
>syslog('debug', 'this is a test') or print "Error\n";
>
>Any ideas ?

Have you started syslogd with the -r flag?  My man syslogd man page says:

       -r     This  option  will  enable  the facility to receive
              message from the network using an  internet  domain
              socket  with  the syslog service (see services(5)).
              The default is to not receive any messages from the
              network.

              This  option  is  introduced  in version 1.3 of the
              sysklogd package.  Please  note  that  the  default
              behavior  is  the  opposite  of  how older versions
              behave, so you might have to turn this on.

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: Tue, 4 Nov 1997 08:49:56 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: transpose file
Message-Id: <ebohlmanEJ45v8.HMp@netcom.com>

chk@rrz.Uni-Koeln.DE wrote:
: what would be the most memory-efficient
: way to read each row from one file and write
: these rows as the columns of an output file?

You might want to do a DejaNews search on comp.lang.perl.announce for 
"Data::Locations" which is a module that's supposed to make this sort of 
thing (outputting data in an order different from the order it was 
generated) easy.



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

Date: Mon, 03 Nov 1997 15:11:26 -0500
From: Josh <josh@jersey.net>
Subject: Where the HECK do you get blat
Message-Id: <345E2FEE.76F7@jersey.net>

Well, that's about it:)
Josh
josh@jersey.net


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

Date: 4 Nov 1997 14:46:27 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Where the HECK do you get blat
Message-Id: <63ncg3$sk9@news-central.tiac.net>

In article <345E2FEE.76F7@jersey.net>, Josh  <josh@jersey.net> wrote:
>Well, that's about it:)

You can use one of the internet search engines to find most things, a
search at http://www.hotbot.com on

  blat mail distribution site

threw up http://interoz.com/mail/ANNOUNCE.TXT which seems to contain
useful pointers.

You can also use search engines like hotbot and dejanews
(http://www.dejanews.com) to search for stuff like this and any perl
related questions.

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

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

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