[13473] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 883 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 23 03:07:37 1999

Date: Thu, 23 Sep 1999 00:05:16 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <938070315-v9-i883@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 23 Sep 1999     Volume: 9 Number: 883

Today's topics:
        ./  -- why? <post.it@in.newsgroup.pls>
    Re: ./  -- why? (Martien Verbruggen)
    Re: ./  -- why? (Michael Budash)
    Re: Automating Secure Copy using Perl <tjk@tksoft.com>
    Re: Beyond wantarray: Determining if sub should return  <rootbeer@redcat.com>
    Re: Converting C Program to Perl <corlando@NOTpop.phnx.uswest.net>
    Re: extract contents of .gz files (Dave Bailey)
    Re: finding number of items in an array <makkulka@cisco.com>
        how to test if a file is a link? j9feng@my-deja.com
    Re: how to test if a file is a link? <jkline@one.net>
    Re: My glob failed <synced@austin.rr.com>
    Re: My glob failed (Martien Verbruggen)
        No parsed headers nileshnimkar@yahoo.com
    Re: No parsed headers (Bill Moseley)
    Re: Output pipes to a browser <carlo.mantini@fmr.com>
        Perl - CGI -MySQL KernelKlink@webtv.net
        PERL PROBLEM - ERROR 405 method not allowed <cmmktg@cybermart.com.sg>
        perl, mod_perl, etc. expert <angus@tellme.com>
    Re: printf mask? (Larry Rosler)
        Setting process name (Bill Moseley)
    Re: Setting process name <uri@sysarch.com>
    Re: Setting process name (Bill Moseley)
    Re: Setting process name <jkline@one.net>
    Re: Setting process name (Martien Verbruggen)
    Re: threads and win32 <jesus.escribanoNOzxSPAM@telefonica.es>
    Re: You should be admired (Henry Penninkilampi)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 23 Sep 1999 00:18:30 -0400
From: "Jeff" <post.it@in.newsgroup.pls>
Subject: ./  -- why?
Message-Id: <7scaag$91b$1@gaddy.interpath.net>

Hello,
I am wondering why would I need to precede my Perl script with a " ./ " to
get it to execute?  I am using a Red Hat server.  When I run this script on
a Slackware server it doesn't need the ./ in front of the file name.

Thanks for any help in advance.

Jeff




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

Date: Thu, 23 Sep 1999 05:07:02 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: ./  -- why?
Message-Id: <WziG3.61$_E3.2851@nsw.nnrp.telstra.net>

In article <7scaag$91b$1@gaddy.interpath.net>,
	"Jeff" <post.it@in.newsgroup.pls> writes:
> Hello,
> I am wondering why would I need to precede my Perl script with a " ./ " to
> get it to execute?  I am using a Red Hat server.  When I run this script on
> a Slackware server it doesn't need the ./ in front of the file name.

This is not a perl question. You will have the same problem with any
executable on your system. The thing is that your path is set to
something sensible on the one box (without . in it), and to something
which I consider bad on the Slackware (with . in it)

Next time if you have problems with your environment, ask on a more
appropriate group, please.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | Freudian slip: when you say one thing
Commercial Dynamics Pty. Ltd.       | but mean your mother.
NSW, Australia                      | 


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

Date: Wed, 22 Sep 1999 22:04:28 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: ./  -- why?
Message-Id: <mbudash-2209992204280001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>

In article <7scaag$91b$1@gaddy.interpath.net>, "Jeff"
<post.it@in.newsgroup.pls> wrote:

>Hello,
>I am wondering why would I need to precede my Perl script with a " ./ " to
>get it to execute?  I am using a Red Hat server.  When I run this script on
>a Slackware server it doesn't need the ./ in front of the file name.
>
>Thanks for any help in advance.
>
>Jeff

if the script can't be found in the PATH, it can't be run. apparently '.'
isn't in your PATH on your RedHat server... of course, it can be added in
any number of places thusly:

PATH=.:$PATH
export PATH

hth-
-- 
Michael Budash ~~~~~~~~~~ mbudash@sonic.net


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

Date: Wed, 22 Sep 1999 23:32:04 -0700
From: Troy <tjk@tksoft.com>
Subject: Re: Automating Secure Copy using Perl
Message-Id: <37E9C964.1DAD23ED@tksoft.com>

floodrk@my-deja.com wrote:
> 
> BACKGROUND
> 
> I've got about 100 Linux machines around the world which I will call
> remotes.  I have one Sun Solaris workstation which I will call local.
> I use secure copy (i.e. scp) to transfer large files from my remote
> hosts to a local workstation.
> 
> WHAT I WANT TO DO
> 
> Recently, I've had a lot of problems with scp crashing out in the
> middle of large file transfers.  So, I want to write a Perl script that
> copies each file in a certain directory using secure copy.  I want my
> script to realise if it was unsuccessful in copying the file, and retry.
> 
> I thought I could detect errors using $?, but I can't seem to get it to
> work.
> 
> MY CURRENT APPROACH
> 
> Here is what I'm trying:
> 
> ________________________
> #!/usr/bin/perl
> 
> @files=`/bin/ls `;
> foreach $file (@files)
> {
> chop($file);
> print "scp ./$file rflood\@dhcp-019189.scott.af.mil:/home/rflood/\n";
>    open(INPUT,`/usr/local/bin/scp ./$file rflood\@dhcp-
> 019189.scott.af.mil:/home/rflood/|`);
> 
> close(INPUT);
> 
> print "$?\n";
> }
> 
>  open(INPUT,`/usr/local/bin/scp -B sdassa rflood\@dhcp-
> 019189.scott.af.mil:/home/rflood/|`);
> 
> close(INPUT);
> print "$?\n";
> #print "killed" if $?;
> 
> __________________________________
> 
> PROBLEM WITH CURRENT APPROACH
> 
> Now, say I kill the sshd daemon on the host this script is supposed to
> copy to, and then run this script on a remote.  I want to be able to
> detect the error.  What happens is that $? is still zero.  My script
> returns control to me, and then few seconds later I get the error
> messages:
> 
>         Secure connection to dhcp-019189.scott.af.mil refused.
>         lost connection
>         Secure connection to dhcp-019189.scott.af.mil refused.
>         lost connection
>         Secure connection to dhcp-019189.scott.af.mil refused.
>         lost connection
Use code like this instead:

my $err = `scp $file remote:/remdir/ 2>&1`;
die ("scp failed.") if ($err || $?);


Troy



 

>         Secure connection to dhcp-019189.scott.af.mil refused.
>         lost connection
> 
> Is there a way for my program to detect this, so that I can properluy
> handle it?  It seems like I should be able to do this with:
> foreach $file (@files)
> {
> chop($file);
> print "scp ./$file rflood\@dhcp-019189.scott.af.mil:/home/rflood/\n";
>    open(INPUT,`/usr/local/bin/scp ./$file rflood\@dhcp-
> 019189.scott.af.mil:/home/rflood/|`);
> while (<INPUT>)
> {
>         if (/Secure connection to dhcp-019189.scott.af.mil refused/)
>                 [do something else]
> }
> close(INPUT);
> 
> print "$?\n";
> 
> but this does not seem to work.  Is there a way to tell open that I
> want to see standard error instead of standard output?
> 
> Am I totally off-base?
> 
> Any help would be greatly appreciated.
> 
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.


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

Date: Wed, 22 Sep 1999 17:27:09 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Beyond wantarray: Determining if sub should return hash or array
Message-Id: <Pine.GSO.4.10.9909221657130.26916-100000@user2.teleport.com>

[ follow-ups set to c.l.p.moderated ]

On Wed, 22 Sep 1999, scottle wrote:

> I know that wantarray will tell me if the context is SCALAR, LIST, or
> void, but I need more information that just LIST. I want to know if
> the context was a Hash list or an Array list, if you get my meaning.

Yes, we could make wantarray return different values to indicate more
information about the return context. So long as they're all true values,
that would be backwards compatible wrt the docs.

This would be useful for more than your stated purpose. split() is a
built-in which knows how many scalar elements are in its target literal
list. So far, that's information that's unavailable to user functions.
Perhaps we could use wantarray to give that number. Here's one possible
(and somewhat complex) set of values of wantarray for various calls:

    %fred = &myfunc();			# 'HASH'

    @barney = &myfunc();		# 'ARRAY'

    ($fred, $barney) = &myfunc();	# 2

    ($fred, @barney) = &myfunc();	# 'LIST'

    $fred = &myfunc();			# ''

    &myfunc();				# undef

    ($fred) = &myfunc();		# 1

    () = &myfunc();			# "0 but true"

Of course, your code would need to 'use 5.7' or some such to check that
this feature is available - the current return value from wantarray in any
of these list contexts is 1. Oh, well!

I'm not sure whether the distinction made above between 'ARRAY' and 'LIST'
is useful. It would imply a difference between these two cases:

    @barney = &myfunc();		# 'ARRAY'

    (@barney) = &myfunc();		# 'LIST'

Hmmmm....

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/


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

Date: Wed, 22 Sep 1999 23:40:57 -0700
From: "rootdog" <corlando@NOTpop.phnx.uswest.net>
Subject: Re: Converting C Program to Perl
Message-Id: <jXjG3.715$de.62973@news.uswest.net>


> Is there a Perl script that will convert C variables to Perl $ variables?
>
> Ed

You could probably use the Covertmycvars::Ondemand module. Its author
Abigail is a frequent poster who enjoys developing Perl code for any newbie
who asks. If you are fortunate enough to get his *ploink* reply this means
he has taken a special interest in you and will generate  code for you any
time you ask.




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

Date: Thu, 23 Sep 1999 06:34:13 GMT
From: dave@ribbit.vfrogs.com (Dave Bailey)
Subject: Re: extract contents of .gz files
Message-Id: <slrn7ujif7.p4q.dave@ribbit.vfrogs.com>

On 23 Sep 1999 02:50:36 GMT, BLUESRIFT <bluesrift@aol.com> wrote:
>I'm a beginner learning and experimenting with Perl on Hypermart.  Hypermart
>apparently automatically updates a raw.gz log...

Try Compress::Zlib on www.cpan.org; it's a Perl module which 
provides you with an API for reading and writing gzipped files.

-- 
Dave Bailey
dave@vfrogs.com


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

Date: Wed, 22 Sep 1999 20:20:04 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: finding number of items in an array
Message-Id: <37E99C64.112B595F@cisco.com>

[ mikej wrote:

> What would be the easisest way to find out how many items I have in an
> array? I am reading in a text file and need to find out how many entries
> (seperated by "|") are in the file at any given time. Here's my
> subroutine where I need to incorporate it:

$length = @array ;
$length = $#array +1 ;
$length =scalar( @array );

use one of these techniques to find number of items in @myimage.
Keep a running counter.
-



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

Date: Thu, 23 Sep 1999 05:08:30 GMT
From: j9feng@my-deja.com
Subject: how to test if a file is a link?
Message-Id: <7scck8$gdk$1@nnrp1.deja.com>

As we all know, we can use -e -d -r -w etc to test a file's property.
Now my question is how to test if a file is a symbolic or hard link.

I am writing a perl script. First, list all the file in 'pwd', then test
if it is a directory, if it is, I recursively chdir into it and list the
files again. The problem is that if it is a link which links to its
parent(or grandparent) directory, I will get an infinite loop. So I need
to test if it is a link before I do 'chdir'.

How could I do it in Perl?
Thanks!
Jay


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 23 Sep 1999 03:03:07 -0400
From: Joe Kline <jkline@one.net>
To: j9feng@my-deja.com
Subject: Re: how to test if a file is a link?
Message-Id: <37E9D0AB.CB20DB52@one.net>

[posted and mailed]

j9feng@my-deja.com wrote:
> 
> As we all know, we can use -e -d -r -w etc to test a file's property.
> Now my question is how to test if a file is a symbolic or hard link.

hmm....

I am assuming we all know about 'perldoc perlfunc'.

A little searching for we get a nice big list of file operators and
all sorts of other goodness:
==========
-X FILEHANDLE 
-X EXPR 
-X 

    A file test, where X is one of the letters listed below. This
unary operator takes one argument, either a filename or a filehandle,
and tests the associated file to see if something is true about it. If
the argument is omitted, tests $_, except for -t, which tests STDIN.
Unless otherwise documented, it returns 1 for TRUE and '' for FALSE,
or the undefined value if the file doesn't exist. Despite the funny
names, precedence is the same as any other named unary operator, and
the argument may be parenthesized like any other unary operator. The
operator may be any of:
   
X<-r>X<-w>X<-x>X<-o>X<-R>X<-W>X<-X>X<-O>X<-e>X<-z>X<-s>X<-f>X<-d>X<-l>X<-
>X<-S>X<-b>X<-c>X<-t>X<-u>X<-g>X<-k>X<-T>X<-B>X<-M>X<-A>X<-C>

        -r  File is readable by effective uid/gid.
        -w  File is writable by effective uid/gid.
        -x  File is executable by effective uid/gid.
        -o  File is owned by effective uid.

        -R  File is readable by real uid/gid.
        -W  File is writable by real uid/gid.
        -X  File is executable by real uid/gid.
        -O  File is owned by real uid.

        -e  File exists.
        -z  File has zero size.
        -s  File has nonzero size (returns size).

        -f  File is a plain file.
        -d  File is a directory.
        -l  File is a symbolic link.
        -p  File is a named pipe (FIFO), or Filehandle is a pipe.
        -S  File is a socket.
        -b  File is a block special file.
        -c  File is a character special file.
        -t  Filehandle is opened to a tty.

        -u  File has setuid bit set.
        -g  File has setgid bit set.
        -k  File has sticky bit set.

        -T  File is a text file.
        -B  File is a binary file (opposite of -T).

        -M  Age of file in days when script started.
        -A  Same for access time.
        -C  Same for inode change time.

    Example: 

        while (<>) {
            chop;
            next unless -f $_;      # ignore specials
            #...
        }

    The interpretation of the file permission operators -r, -R, -w,
-W, -x, and -X is by default based solely on the mode of the file and
the uids and gids of the user. There may be other reasons you can't
actually read, write, or execute the file. Such reasons may be for
example network filesystem access controls, ACLs (access control
lists), read-only filesystems, and unrecognized executable formats. 

    Also note that, for the superuser on the local filesystems, the
-r, -R, -w, and -W tests always return 1, and -x and -X return 1 if
any execute bit is set in the mode. Scripts run by the superuser may
thus need to do a stat() to determine the actual mode of the file, or
temporarily set their effective uid to something else. 

    Note that -s/a/b/ does not do a negated substitution. Saying
-exp($foo) still works as expected, however--only single letters
following a minus are interpreted as file tests. 

    The -T and -B switches work as follows. The first block or so of
the file is examined for odd characters such as strange control codes
or characters with the high bit set. If too many strange characters
(>30%) are found, it's a -B file, otherwise it's a -T file. Also, any
file containing null in the first block is considered a binary file.
If -T or -B is used on a filehandle, the current stdio buffer is
examined rather than the first block. Both -T and -B return TRUE on a
null file, or a file at EOF when testing a filehandle. Because you
have to read a file to do the -T test, on most occasions you want to
use a -f against the file first, as in next unless -f $file && -T
$file. 

    If any of the file tests (or either the stat() or lstat()
operators) are given the special filehandle consisting of a solitary
underline, then the stat structure of the previous file test (or stat
operator) is used, saving a system call. (This doesn't work with -t,
and you need to remember that lstat() and -l will leave values in the
stat structure for the symbolic link, not the real file.)
    Example: 

        print "Can do.\n" if -r $a || -w _ || -x _;

        stat($filename);
        print "Readable\n" if -r _;
        print "Writable\n" if -w _;
        print "Executable\n" if -x _;
        print "Setuid\n" if -u _;
        print "Setgid\n" if -g _;
        print "Sticky\n" if -k _;
        print "Text\n" if -T _;
        print "Binary\n" if -B _;
==========

Or did you what the simple answer that :

if ( -l $file_path)
{ #blah}

will be true if the item in question is a link?

joe - killing with kindness


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Thu, 23 Sep 1999 03:37:36 GMT
From: Kevin Colquitt <synced@austin.rr.com>
Subject: Re: My glob failed
Message-Id: <Pine.LNX.4.10.9909222235180.28790-100000@kalimoth.death.org>

Martien,

Your code doesn't work. you run this and tell me what you get.
 
 #! /usr/bin/perl
 @results = q(export       csmkdc   webdev   13716   302-44446 (135.147.1.148) Tue Sep 21 18:52:34 1999);

 ($dir, $userid, $groupid, $pid, $computer, $ipaddress, $day, $month, $date, $hour, $year) = split ' ', $results[6];

  print "$dir, $userid, $groupid, $pid, $computer, $ipaddress, $day, $month, $date, $hour, $year \n";

Gives me the following:
[synced@kalimoth perlland]$ perl test.pl
, , , , , , , , , ,
[synced@kalimoth perlland]$


besides, I've used a similar technique to get to values to commands like
"date" for example:
@date = `/bin/date`;
($day, $month, $date, $hour, $locale, $year) = <@date>;
print " $day, $month, $date, $hour, $locale, $year \n"

works the way I know it should with the output being:
[synced@kalimoth perlland]$ perl new.pl
 Wed, Sep, 22, 22:45:54, CDT, 1999

Kevin

On Thu, 23 Sep 1999, Martien Verbruggen wrote:

:In article <Pine.LNX.4.10.9909221740270.28639-100000@kalimoth.death.org>,
:	Kevin Colquitt <synced@austin.rr.com> writes:
:
:> The value for @results[6] should be something like:
:> 
:>> export       csmkdc   webdev   13716   302-44446 (135.147.1.148) \
:	Tue Sep 21 18:52:34 1999
:> 
:> and I'm trying to parse out the fields with the following:
:> 
:>> ($dir, $userid, $groupid, $pid, $computer, $ipaddress, $day, 
:>	$month, $date, $hour, $year) = <@results[6]>;
:> 
:> Which gives me the error "glob failed (child exited with status 1)
:> at test.pl line "
:
:And it would. <@results[6]> is a glob. (perldoc perlop, and perldoc -f
:glob). What did you think it was?
:
:I think what you want is split, with a pettern of space:
:
:($dir, $userid, $groupid, $pid, $computer, $ipaddress, $day, 
:	$month, $date, $hour, $year) = 
:	split ' ', @results[6];
:
:# perldoc -f split
:
:And please, _do_ read the split manual entry, even though you have the
:answer already.
:
:Martien
:-- 
:Martien Verbruggen                  | 
:Interactive Media Division          | Hi, Dave here, what's the root
:Commercial Dynamics Pty. Ltd.       | password?
:NSW, Australia                      | 
:
:



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

Date: Thu, 23 Sep 1999 05:04:58 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: My glob failed
Message-Id: <_xiG3.60$_E3.2851@nsw.nnrp.telstra.net>

In article <Pine.LNX.4.10.9909222235180.28790-100000@kalimoth.death.org>,
	Kevin Colquitt <synced@austin.rr.com> writes:
> Martien,
> 
> Your code doesn't work. you run this and tell me what you get.

The code runs fine. Please don't assume my code is wrong until you are
certain that that is the problem. It's not polite :)

>  @results = q(export       csmkdc   webdev   13716   302-44446 (135.147.1.148) Tue Sep 21 18:52:34 1999);

You now have an array with _one_ element, $result[0].

>  ($dir, $userid, $groupid, $pid, $computer, $ipaddress, $day, $month, $date, $hour, $year) = split ' ', $results[6];

You try to split $results[6] which is undefined, because you didn't
actually define it.

Try splitting $results[0]

If you had used the -w flag perl would have told you.

> besides, I've used a similar technique to get to values to commands like
> "date" for example:
> @date = `/bin/date`;
> ($day, $month, $date, $hour, $locale, $year) = <@date>;
> print " $day, $month, $date, $hour, $locale, $year \n"

<@array> is not the same thing as <$variable>

You're free to use whatever you fancy, but don't complain to us when
your non-standard hacks stop working or don't work as you want them to
work. split is there to do what you want. globs are for a totally
different thing.

This also works:

# perl -w
$a = "aaa bbb ccc";
@b = <@{[$a]}>;
print "@b\n";
__END__
aaa bbb ccc

Does that mean that you should use it?

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd.       | cynical. It's perfectly easy to be
NSW, Australia                      | cynical.


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

Date: Thu, 23 Sep 1999 04:59:40 GMT
From: nileshnimkar@yahoo.com
Subject: No parsed headers
Message-Id: <7scc3p$g1q$1@nnrp1.deja.com>

I am new so I dont know how to post properly.
Here is the problem. I have written a script which uses NPH to update a
page automatically. The page (actually a stock market simulation from
Using CGI.pm by Lincon Stien) updates at the end but does not scroll
automitaclly. How do I make it scroll ?? Can I do this using HTML alone
or do I have to use javascript.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 22 Sep 1999 22:46:24 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: No parsed headers
Message-Id: <MPG.12535e8e2310ceca98976e@nntp1.ba.best.com>

nileshnimkar@yahoo.com (nileshnimkar@yahoo.com) seems to say...
> I am new so I dont know how to post properly.
> Here is the problem. I have written a script which uses NPH to update a
> page automatically. The page (actually a stock market simulation from
> Using CGI.pm by Lincon Stien) updates at the end but does not scroll
> automitaclly. How do I make it scroll ?? Can I do this using HTML alone
> or do I have to use javascript.

perldoc -f print

BTW -- if I use NPH will it update my pages automatically, too?

(Read, why bother with NPH?)

-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: Wed, 22 Sep 1999 14:55:16 -0400
From: Carlo Mantini <carlo.mantini@fmr.com>
Subject: Re: Output pipes to a browser
Message-Id: <37E92613.5A79DC6C@fmr.com>

Thanks for answering.  I now have output going to the browser, so I was remiss
in checking for responses to my inquiry.  Thanks again.

An interesting sidenote:  Although I have output going to the browser, the
same script does not produce correct output when I run it from the command
line!  Oh well...

Makarand Kulkarni wrote:

> [ Carlo Mantini wrote:
>
> >  When I run the script from a command line, the output is
> > sent to my screen. No error messages are being written to the log by the
> > web server.
>
> Do you see lines like
> Content-Type:text/html\n\n
> which tell the browser the content type, printed out when you run
> your programs on the command line. If not, then you have
> to add this HTTP header.
> --





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

Date: Wed, 22 Sep 1999 23:10:45 -0400 (EDT)
From: KernelKlink@webtv.net
Subject: Perl - CGI -MySQL
Message-Id: <18727-37E99A35-1@newsd-211.iap.bryant.webtv.net>

I wrote a perl script that when called via a web browser, will first
connect to a MySQL server, then add a table, then disconnect.  

I ran into a problem after the 10th table was added. It won't add any
more tables even after I delete all the tables. I can still add tables
via the command line.

Is there usually an option on a MySQL server that might turn off the
ability to add tables via a Perl/cgi-bin connect after a certain amount
has been reached?



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

Date: Thu, 23 Sep 1999 11:21:20 -1000
From: CyberMart <cmmktg@cybermart.com.sg>
Subject: PERL PROBLEM - ERROR 405 method not allowed
Message-Id: <37EA99D0.1E6F4AFB@cybermart.com.sg>

i all,

How to configure PERL in the NT registry as I getting an error message
"HTTP ERROR 405
405 Method not allowed. The method specified in the request line is not
allowed for the resource identified by the request. please ensure that
you have the proper MIME type set up for the resource you are
requesting.

When I run the script, it is working in the PERL, when submitting form I
encountered the above error message.

Please help



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

Date: Wed, 22 Sep 1999 20:55:44 -0700
From: Angus Davis <angus@tellme.com>
Subject: perl, mod_perl, etc. expert
Message-Id: <37E9A4C0.B995E24D@tellme.com>

Tellme Networks is an Internet start-up company in Palo Alto, California
-- see http://www.tellme.com/. Recent articles about our company from
the Wall Street Journal, New York Times, Forbes, Seattle Times, AP,
Reuters, News.com, etc. can be found online at
http://www.tellme.com/newsclips/.

Currently we're looking to hire a Web engineer with lots of Perl and
mod_perl experience in a production environment. Here's the complete job
description:

"Do you love to solve really hard problems, simplify algorithms, write
lots of code, and fix bugs? Do you like to work with other super-smart
engineers? Have you hacked mod_perl? Have you shipped highly scalable
production code that powers popular sites? Do you work well on a web
team with producers, designers and marketing folk? If you have 2+ years
of technical experience including C/C++, CGI, Perl, and HTML, tell us
about yourself. We aren't looking for Java experience, but extensive
Perl and C knowledge is a must."

Please take 2 minutes to check us out at http://www.tellme.com/. Some of
our investors include Jim Barksdale (former CEO, Netscape) and Brad
Silverberg (former SVP of Windows and Internet divisions and Microsoft).
For some brief glimpses into our company's culture, visit
http://www.tellme.com/photos/.  If you're interested in learning more,
just fire off your resume or other such info to jobs@tellme.com. Thanks,

-angus



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

Date: Wed, 22 Sep 1999 23:27:40 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: printf mask?
Message-Id: <MPG.12536831c3dc7056989fc1@nntp.hpl.hp.com>

In article <7sbiv6$f99$1@engnews2.Eng.Sun.COM> on 22 Sep 1999 21:50:30 
GMT, Joe Petolino <petolino@joe.Eng.Sun.COM> says...
> >> >This is probably a simple question, but it has me stumped.  I need to
> >> >convert a hex string to binary and write the resulting binary string to
> >> >an output file.  Can I do it with printf, is there an appropriate mask?
 ...

<SNIP> of hash reproduced below.

>     print map($hexbits{$_}, split(//, lc($hexstring) ));

One might add the corresponding upper-case letters to the hash, and drop 
the call to lc().  Even doing that, however, and not counting the setup 
of the hash, the 'pack/unpack' solution is almost twice as fast.  I'm 
surprised by that!

Benchmark: timing 16384 iterations of jp, lr...
        jp:  5 wallclock secs ( 4.88 usr +  0.00 sys =  4.88 CPU)
        lr:  3 wallclock secs ( 2.86 usr +  0.00 sys =  2.86 CPU)

#!/usr/local/bin/perl -w
use strict;
use Benchmark;

my $hexstring = '464646204646460a';

my %hexbits = (
	'0' => '0000',
	'1' => '0001',
	'2' => '0010',
	'3' => '0011',
	'4' => '0100',
	'5' => '0101',
	'6' => '0110',
	'7' => '0111',
	'8' => '1000',
	'9' => '1001',
	'a' => '1010',	'A' => '1010',
	'b' => '1011',	'B' => '1011',
	'c' => '1100',	'C' => '1100',
	'd' => '1101',	'D' => '1101',
	'e' => '1110',	'E' => '1110',
	'f' => '1111',	'F' => '1111',
    );

timethese(1 << (shift || 0), {
  jp  => sub { map $hexbits{$_}, split //, $hexstring },
  lr  => sub { unpack 'B*' => pack 'C*' =>
                   map hex, $hexstring =~ /(..)/g },
});

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Wed, 22 Sep 1999 22:37:43 -0700
From: moseley@best.com (Bill Moseley)
Subject: Setting process name
Message-Id: <MPG.12535c86f5a74aa898976d@nntp1.ba.best.com>

Eighteen hour days are tough on the memory.

I thought I remembered reading somewhere in perldoc a way to set the 
name ps sees for a forked process.  Was that a dream or did I see it 
some place?

I just quickly looked over perlipc again didn't find it.




-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: 23 Sep 1999 01:51:04 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Setting process name
Message-Id: <x77lli41mf.fsf@home.sysarch.com>

>>>>> "BM" == Bill Moseley <moseley@best.com> writes:

  BM> Eighteen hour days are tough on the memory.
  BM> I thought I remembered reading somewhere in perldoc a way to set the 
  BM> name ps sees for a forked process.  Was that a dream or did I see it 
  BM> some place?

$0

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: Wed, 22 Sep 1999 23:09:17 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Setting process name
Message-Id: <MPG.125363eb8720f1fc989771@nntp1.ba.best.com>

Uri Guttman (uri@sysarch.com) seems to say...
> >>>>> "BM" == Bill Moseley <moseley@best.com> writes:
> 
>   BM> Eighteen hour days are tough on the memory.
>   BM> I thought I remembered reading somewhere in perldoc a way to set the 
>   BM> name ps sees for a forked process.  Was that a dream or did I see it 
>   BM> some place?
> 
> $0

I've see ;) and :'( and >:o but what does $0 say?  My brain is 
scrambled?

Don't you sleep, Uri?

-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: Thu, 23 Sep 1999 02:48:07 -0400
From: Joe Kline <jkline@one.net>
Subject: Re: Setting process name
Message-Id: <37E9CD27.3BC25ECE@one.net>

[posted and mailed]

Bill Moseley wrote:
> 
> Uri Guttman (uri@sysarch.com) seems to say...
> > >>>>> "BM" == Bill Moseley <moseley@best.com> writes:
> >
> >   BM> Eighteen hour days are tough on the memory.
> >   BM> I thought I remembered reading somewhere in perldoc a way to set the
> >   BM> name ps sees for a forked process.  Was that a dream or did I see it
> >   BM> some place?
> >
> > $0
    ^^from perlvar as in 'perldoc perlvar' we find:

$PROGRAM_NAME <-- if you 'use English'
$0 

    Contains the name of the file containing the Perl script being
executed. On some operating systems assigning to ``$0'' modifies the
argument area that the ps(1) program sees. This is more useful as a
way of indicating the current program state than it is for hiding the
program you're running. (Mnemonic: same as sh and ksh.)

> I've see ;) and :'( and >:o but what does $0 say?  My brain is
> scrambled?

Well, it is past 2am EDT... 

> Don't you sleep, Uri?

Eh, catch up on sleep when you're dead.

joe - notice the 0 line .sig ;-)


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Thu, 23 Sep 1999 06:51:26 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Setting process name
Message-Id: <O5kG3.88$_E3.3569@nsw.nnrp.telstra.net>

In article <MPG.125363eb8720f1fc989771@nntp1.ba.best.com>,
	moseley@best.com (Bill Moseley) writes:
> Uri Guttman (uri@sysarch.com) seems to say...
>> >>>>> "BM" == Bill Moseley <moseley@best.com> writes:
>> 
>>   BM> Eighteen hour days are tough on the memory.
>>   BM> I thought I remembered reading somewhere in perldoc a way to set the 
>>   BM> name ps sees for a forked process.  Was that a dream or did I see it 
>>   BM> some place?
>> 
>> $0
> 
> I've see ;) and :'( and >:o but what does $0 say?  My brain is 
> scrambled?

It says 'you will have to read the perlvar documentation, because my
hair is in a mess, and they won't allow me to enter the library in a
state like that, so I can't read it for you, and I am sure that I have
seen a mention of a variable with the name 0 in there somewhere that
signifies the process name, with an explanation of what happens when
you assign to it (on certain operating systems).

Martien

PS. $:->
-- 
Martien Verbruggen                  | 
Interactive Media Division          | 
Commercial Dynamics Pty. Ltd.       | Curiouser and curiouser, said Alice.
NSW, Australia                      | 


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

Date: Thu, 23 Sep 1999 00:01:08 -0700
From: chusqui <jesus.escribanoNOzxSPAM@telefonica.es>
Subject: Re: threads and win32
Message-Id: <109aa7be.929518ad@usw-ex0102-012.remarq.com>

Lot of thanks.
Chusqui

****Pero mi Perl es mucho pero que tu espaņol****

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Thu, 23 Sep 1999 16:06:33 +0930
From: spamfree@metropolis.net.au (Henry Penninkilampi)
Subject: Re: You should be admired
Message-Id: <spamfree-2309991606340001@d6.metropolis.net.au>

In article <slrn7uifmp.e5i.abigail@alexandra.delanet.com>, Abigail
<abigail@delanet.com> wrote:

> ## In my book, it's OK to make a mistake *once* and we should all exercise a
> ## little bit of patience when newbies pose questions.  Venomous attacks are
> ## possibly best reserved for those that *repeatedly* demonstrate their lack
> ## of research skills, don't you think?
> 
> No. You're a whiner.

:^o  Oooohhh.  Gee that hurt.  Sniff, sniff.

Tell me, Abigail, how does a petulant child gain respect in life?  I'm
wondering if you know - you seem to be an authority on the subject.

While you're thinking about that one, you might also want to look up the
definition of the word "whiner" in a dictionary (it's under 'w'), because
you obviously don't know what it means.

Oh, and look up 'prozac' as well.

:^P

Henry.


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

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

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V9 Issue 883
*************************************


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