[19796] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1991 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 23 14:07:10 2001

Date: Tue, 23 Oct 2001 11:05:08 -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: <1003860308-v10-i1991@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 23 Oct 2001     Volume: 10 Number: 1991

Today's topics:
    Re: Can anyone sugest a way to reduce the CPU usage of  (Stan Brown)
    Re: Can I read BLOB as stream by DBI (Jason Kohles)
    Re: Can I read BLOB as stream by DBI <djberge@uswest.com>
        CGI::Lite file upload corruption <<void@127.0.0.1>>
    Re: CGI::Lite file upload corruption <kristian.fischer@koehlershohn.de>
        Hello <btarver@clevemed.com>
    Re: Help decoding an encoded string from MySql with per <abe@ztreet.demon.nl>
        how to gzip a file (web)? <danade@wnt.sas.com>
        NEWBIE: Sorting a hash by value <stevoarnold@yahoo.co.uk>
    Re: NEWBIE: Sorting a hash by value <hillr@ugs.com>
    Re: NEWBIE: Sorting a hash by value <uri@sysarch.com>
    Re: NEWBIE: Sorting a hash by value <jasper@guideguide.com>
        Paragraph marks at end of EVERY line in MSWord->HTML fi (Richard Brust)
        Perl for Win32::EventLog (wbracken)
        perl on WinNT sever install trouble shooting (Arthur Doohan)
    Re: Perl Vs. Java <lmoran@wtsg.com>
    Re: Problem installing  lcwa-1.0.0 (Jason Kohles)
        SDBM_File size limit? <bing-du@tamu.edu>
    Re: Using a remote file with a Perl script (Marc Bissonnette)
    Re: Webpage Passwords (Tad McClellan)
    Re: What the **** is WRONG with this!? (John J. Trammell)
    Re: What the **** is WRONG with this!? (Jason Kohles)
    Re: What the **** is WRONG with this!? <me@REMOVETHIStoao.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 23 Oct 2001 11:41:00 -0400
From: stanb@panix.com (Stan Brown)
Subject: Re: Can anyone sugest a way to reduce the CPU usage of this script?
Message-Id: <9r432c$8se$1@panix2.panix.com>

In <871yju5s51.fsf@homer.cghm> Andrew Cady <please@no.spam> writes:


>Apparently, the routed process itself is dying (as opposed to locking
>up), which means your approach here is all wrong.  You should
>fork/exec and wait() for SIGCHLD (and loop when you get it).  But
>then, not "you" personally (or your code).  Have init do this.  It
>will likely do it better.  man 8 init; man 5 inittab.

Thanks, U had thought of that, but for some reason I went this route. Maybe
I need to rethink it.
-- 
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
						-- Benjamin Franklin


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

Date: 23 Oct 2001 15:16:11 GMT
From: usenet@jasonkohles.com (Jason Kohles)
Subject: Re: Can I read BLOB as stream by DBI
Message-Id: <slrn9tb2a4.9i9.usenet@poseidon.mediabang.com>

On 23 Oct 2001 02:48:37 -0700, derek chen wrote:
>I can have a blob value saved in a file like this 
>but I'm afraid that the data is too large to be stored in a variable.
>Is there any method that I can manipulate the data as stream like
>
Depending on the database/DBD combination, you may be able to use the
undocumented $sth->blob_read($id,$offset,$len) method, or use the database
servers own support for putting blobs into files.

>BTW,I still can't understand how to use {LongTruncOk} .Is it used for judging
>if my data is stored in the variable succesfully?But if it fails,it will break
>the while loop,why do I need it ?Thanks.
>
LongTruncOk is used together with LongReadLen, if you set LongReadLen to some
value, such as 1024, and LongTruncOk is true, then you will only get the
first 1024 bytes of that field, even though it may have been much longer.

-- 
Jason S Kohles
email@jasonkohles.com          http://www.jasonkohles.com/


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

Date: Tue, 23 Oct 2001 12:16:30 -0500
From: Mr Sunblade <djberge@uswest.com>
Subject: Re: Can I read BLOB as stream by DBI
Message-Id: <3BD5A5EE.1E6DBB2@uswest.com>

Jason Kohles wrote:

<snip>

> LongTruncOk is used together with LongReadLen, if you set LongReadLen to some
> value, such as 1024, and LongTruncOk is true, then you will only get the
> first 1024 bytes of that field, even though it may have been much longer.
>
> --
> Jason S Kohles
> email@jasonkohles.com         http://www.jasonkohles.com/

On a side note, you probably don't want to use a power of 2 (i.e. 1024 as
mentioned above) as the LongReadLen value.  To quote the footnote from Tim Bunce's
"Using the Perl DBI", p.142 (O'Reilly & Associates):

"Using a value which is a power of two, such as 64 KB, 512 KB, 8MB, etc., can
actually cause twice that amount to be taken on systems that have poor memory
allocators.  That's because a few extra bytes are needed for housekeeping
information and, because the dumb allocator only works with powers of two, it has
to double the allocation to make room for it."

Regards,

Mr. Sunblade

--
"Evil will always triumph because Good is *dumb*."
-- Dark Helmet, 'Spaceballs: The Movie'





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

Date: Tue, 23 Oct 2001 15:12:27 GMT
From: "Josh" <<void@127.0.0.1>>
Subject: CGI::Lite file upload corruption
Message-Id: <vNfB7.43915$1%.11932332@typhoon.nyroc.rr.com>

I'm using CGI::Lite on ActiveState's Perl for ISAPI on MS IIS5.  What's
happening is that CGI::Lite is replacing all \n (Hex 0a) with \r\n (Hex 0d
0a) in the uploaded binary files, which are MS Word or Excel files, and that
corrupts them.  I was under the impression that CGI::Lite only performs EOL
translation for mime types it has set, so I remove all mime types, as both
clients and servers are all Windows machines, so EOL transaction shouldn't
be necessary.

Anyone have any insight or help as to prevent this corruption or see any
mistakes in my code?

Thanks,
Josh

***code***
my $cgi = new CGI::Lite; #cgi object
#this all has to be set up before calling parse_form_data
$cgi->set_platform('Windows'); #what we're OS we're on
foreach my $mimetype ($cgi->get_mime_types()) {
 $cgi->remove_mime_type($mimetype);
}
$cgi->set_directory('temp') or die "Cannot set directory: $!\n\n"; #temp dir
for file upload
$cgi->add_timestamp(0); #we don't need a time stamp
$cgi->filter_filename(\&transform_filename);
my %form = $cgi->parse_form_data; #get the form data
***end code***




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

Date: Tue, 23 Oct 2001 19:40:33 +0200
From: Kristian Fischer <kristian.fischer@koehlershohn.de>
Subject: Re: CGI::Lite file upload corruption
Message-Id: <3BD5AB91.FFB757C4@koehlershohn.de>

Hallo
"Josh <" wrote:
> 
> I'm using CGI::Lite on ActiveState's Perl for ISAPI on MS IIS5.  What's
> happening is that CGI::Lite is replacing all \n (Hex 0a) with \r\n (Hex 0d
> 0a) in the uploaded binary files, which are MS Word or Excel files, and that
> corrupts them.  I was under the impression that CGI::Lite only performs EOL
> translation for mime types it has set, so I remove all mime types, as both
> clients and servers are all Windows machines, so EOL transaction shouldn't
> be necessary.

It's not a mistake of the CGI::* moduls.
You should read "perldoc -f binmode"

Regards
 Kristian


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

Date: Tue, 23 Oct 2001 10:19:48 -0400
From: "Bernie X" <btarver@clevemed.com>
Subject: Hello
Message-Id: <4phB7.2444$_K.302021@cletus.bright.net>






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

Date: Tue, 23 Oct 2001 17:07:10 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Help decoding an encoded string from MySql with perl???
Message-Id: <d40btt08sv0rhhjht52agc60c4qsmuctdr@4ax.com>

On Fri, 19 Oct 2001 17:27:58 -0600, "Ryan" <ryan@tuitions.com> wrote:

> I need to know how to decode a string that I have encoded with MySql.
> 
> for example:
> #encode
>   $sql = "INSERT INTO users (Name, Password) VALUES('$username',
> (encode('$pass1','rT')))";
>   $rc = $DBH->do($sql);
> 
> output from encoding:
> ¼-|:l±r
> 
> What is the code for decoding??
> I have tried:
> $password1 = ("select decode($password,$passkey) from users where username =
> '$username'");

Not that it has got anything to do with Perl, but:

    my $passkey = 'rT';
    my $password1 = <<'EOQ';
SELECT Name, decode( Password, ? ) AS Password FROM users
WHERE Name = ?
EOQ

    my $sth = $DBH->prepare( $password1 );
    $sth->execute( $passkey, $username );

You should be using the '?' placeholder, it saves you trouble.

See perldoc DBI for more info on that.

-- 
Good luck, Abe
Amsterdam Perl Mongers http://amsterdam.pm.org
perl -wl
%_ = reverse (tsuJ=>0, rehtona=>1, lreP=>2, rekcah=>3);
@_ = reverse map { ($_{$_}, $_) } sort keys %_;
$_ = reverse join " ", map $_[$_] => grep $_%2 => 0..$#_;
print;


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

Date: Tue, 23 Oct 2001 13:28:00 -0400
From: Dave Naden <danade@wnt.sas.com>
Subject: how to gzip a file (web)?
Message-Id: <RqjVO5J1eJIu84juqasaaeDQsEgG@4ax.com>

Hi Perls,

Does anyone have a simple example of reading a text file, compressing
it into gzip format, and writing it back out?  Even better, anyone
know how this is done in a CGI context?

Thank you all!

Dave Naden
SAS Institute


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

Date: Tue, 23 Oct 2001 16:14:02 +0100
From: "Steve" <stevoarnold@yahoo.co.uk>
Subject: NEWBIE: Sorting a hash by value
Message-Id: <9r41mc$2l4$1@pheidippides.axion.bt.co.uk>

Bit of a newbie question im afraid... here it is:

I have fed into a hash some keys and values. The values are numeric. I am
trying to sort by the numeric values but what I have done means I lose the
keys. my code is below, any ideas how I could achieve this would be greatly
appreciated. (I have borrowed the supersort subfunction from Roberts Perl
Tutorial in case anyone recognises it)

SteveA

foreach ( sort  supersort values %hash)
 {
 print "$_ \t$hash{$_}\n";
 }

sub supersort
 {
 if ($a > $b)
  {return -1;}
 if ($a < $b)
  {return 1;}
 else
  {return 0;}
 }




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

Date: Tue, 23 Oct 2001 09:14:23 -0700
From: "Ron Hill" <hillr@ugs.com>
Subject: Re: NEWBIE: Sorting a hash by value
Message-Id: <3bd595e8$1@usenet.ugs.com>


"Steve" <stevoarnold@yahoo.co.uk> wrote in message
news:9r41mc$2l4$1@pheidippides.axion.bt.co.uk...
> Bit of a newbie question im afraid... here it is:
>
> I have fed into a hash some keys and values. The values are numeric. I am
> trying to sort by the numeric values but what I have done means I lose the
> keys. my code is below, any ideas how I could achieve this would be
greatly
> appreciated. (I have borrowed the supersort subfunction from Roberts Perl
> Tutorial in case anyone recognises it)
>
> SteveA
perldoc -q sort
How do I sort a hash (optionally by value instead of key)?

          Internally, hashes are stored in a way that prevents you from
          imposing an order on key-value pairs. Instead, you have to sort
          a list of the keys or values:

              @keys = sort keys %hash;    # sorted by key
              @keys = sort {
                              $hash{$a} cmp $hash{$b}
                      } keys %hash;       # and by value

          Here we'll do a reverse numeric sort by value, and if two keys
          are identical, sort by length of key, or if that fails, by
          straight ASCII comparison of the keys (well, possibly modified
          by your locale--see the perllocale manpage).

              @keys = sort {
                          $hash{$b} <=> $hash{$a}
                                    ||
                          length($b) <=> length($a)
                                    ||
                                $a cmp $b
              } keys %hash;
 More  --




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

Date: Tue, 23 Oct 2001 16:20:39 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: NEWBIE: Sorting a hash by value
Message-Id: <x7r8ru2upo.fsf@home.sysarch.com>

>>>>> "S" == Steve  <stevoarnold@yahoo.co.uk> writes:

  S> Bit of a newbie question im afraid... here it is: I have fed into a
  S> hash some keys and values. The values are numeric. I am trying to
  S> sort by the numeric values but what I have done means I lose the
  S> keys. my code is below, any ideas how I could achieve this would be
  S> greatly appreciated. (I have borrowed the supersort subfunction
  S> from Roberts Perl Tutorial in case anyone recognises it)

FAQ.
  S> foreach ( sort  supersort values %hash)
  S>  {
  S>  print "$_ \t$hash{$_}\n";
  S>  }

that doesn't do much other than sorting the hash's values. most people
want the keys of the hash sorted by their values. think about that carefully.

  S> sub supersort
  S>  {
  S>  if ($a > $b)
  S>   {return -1;}
  S>  if ($a < $b)
  S>   {return 1;}
  S>  else
  S>   {return 0;}
  S>  }

wow, if that is in that tutorial, i would run away fast. he doesn't even
know about the <=> operator? pathetic.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Search or Offer Perl Jobs  --------------------------  http://jobs.perl.org


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

Date: Tue, 23 Oct 2001 17:27:34 +0100
From: Jasper McCrea <jasper@guideguide.com>
Subject: Re: NEWBIE: Sorting a hash by value
Message-Id: <3BD59A76.EE365185@guideguide.com>

Steve wrote:
> 
> Bit of a newbie question im afraid... here it is:
> 
> I have fed into a hash some keys and values. The values are numeric. I am
> trying to sort by the numeric values but what I have done means I lose the
> keys. my code is below, any ideas how I could achieve this would be greatly
> appreciated. (I have borrowed the supersort subfunction from Roberts Perl
> Tutorial in case anyone recognises it)
>
> SteveA
> 
> foreach ( sort  supersort values %hash)
>  {
>  print "$_ \t$hash{$_}\n";
>  }

what you want is to sort by value and return the key i.e.

foreach my $key (sort { $hash{$a} <=> $hash{$b} } keys %hash) {blah blah
blah}

> 
> sub supersort
>  {
>  if ($a > $b)
>   {return -1;}
>  if ($a < $b)
>   {return 1;}
>  else
>   {return 0;}
>  }

Robert's Perl Tutorial seems to have rewritten the spaceship operator (
<=> ).
Or am I missing something?

Jasper
-- 
      split//,'019617511192'.
      '17011111610114101114'.
      '21011141011840799901'.
            '17101174';
            foreach(0..         # my
            $#_){$_[$_          # signature is too
            ++]^=$_[$_          # bignature
            --]^=$_[$_
]^=$_[++    $_]if!($_%
2)}$g.=$_  ,chr($g)=~
 /(\w)/&&($o.=$1and
   $g='')foreach@_;
      print"$o\n"


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

Date: 23 Oct 2001 10:55:13 -0700
From: brust@tbri.com (Richard Brust)
Subject: Paragraph marks at end of EVERY line in MSWord->HTML file
Message-Id: <f12180f2.0110230955.67a02c24@posting.google.com>

The editing dept does a Save As...*.html on all the MS-Word files we
publish.  However, in the process, each line in the new HTML file now ends
with a paragraph mark.  So, I am trying to write a script that deletes HTML
tags over new lines (which I got to work), but also over paragraph marks.

What I have so far is below, the 2nd and 3rd lines from the bottom are
examples of tags that span multi-lines, and in the process, span the
paragraph marks.  Also, I know it is not actually *doing* anything now, I am
still in the testing phase, which is why all the COLOR constants are
specified...
____________________
#! /usr/bin/perl
use warnings;
use strict;

use Term::ANSIColor qw(:constants);
$Term::ANSIColor::AUTORESET = 1;

# $/ = "";  ###I tried it with this uncommented, the whole file becomes a
big "paragraph", and nothing matches.
while (<>) {
 #remove weird paragraph marks
  s/<\/?o:p>//msgi && print "$i: $`", ON_MAGENTA "|$&|", RESET "$'\n";

 #remove unecessary closing tags
  s/<\/b>//msgi && print "$i: $`", YELLOW "|$&|", RESET "$'\n";
  s/<\/span>//msgi && print "$i: $`", ON_GREEN "|$&|", RESET "$'\n";

 #remove mso-spaceruns
  s/<span\s*(\S+\s*\S+)\">/ /msgi && print  "$i: $`", ON_RED "|$&|", RESET
"$'\n"; #***this is one tag that spans multi lines
 #remove mso image data
  s/<!--\[if gte vml 1\]>.*<!\[endif\]-->//msgi && print  "$i: $`", GREEN
"|$&|", RESET "$'\n"; #***this is one tag that spans multi lines
  s/(v:shapes\S+\s)//msgi && print  "$i: $`", ON_BLUE "|$&|", RESET "$'\n";
}


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

Date: 23 Oct 2001 10:10:26 -0700
From: aacbracken@hotmail.com (wbracken)
Subject: Perl for Win32::EventLog
Message-Id: <d2d7856.0110230910.56f06936@posting.google.com>

I am in the process of trying to convert a old Perl script that was
used to pull the "successfull" logon attempts from all BDC's in the
environment and insert that info into an Access database.  I am
running into the error:
Modification of a read-only value attempted at
c:/perl/site/lib/win32/EventLog.pm line 100.
As you may have guessed I am relatively new to Perl, but being forced
to learn quickly.  I am using the current ActiveState MSI distribution
of Perl (5.61, i believe) and I believe that the script was written in
5.00 or close too.

I am testing this by running it on my own workstations security
eventlog. I am a Local Admin and a Domain Admin, so I don't believe
that it is related to permissions.  Can anyone possibly shed any light
on this??

If you would like more detail, please ask and I'll respond

Thanks in advance!

wbracken


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

Date: 23 Oct 2001 08:37:50 -0700
From: doohana@aol.com (Arthur Doohan)
Subject: perl on WinNT sever install trouble shooting
Message-Id: <eaf94101.0110230737.54dec3c3@posting.google.com>

hello - this is a newbie posting
i have loaded and installed active state Perl and it all seemed to go
seamlessly
However, when i attempt to access the perl console or do anything -
even as simple as perl -v - the console collaspes instantly before
showing any input - what is wrong - it could be me?
any ideas
thanks in advance


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

Date: Tue, 23 Oct 2001 11:18:56 -0400
From: Lou Moran <lmoran@wtsg.com>
Subject: Re: Perl Vs. Java
Message-Id: <1t1bttoueot1ir1du8mu3mjpm4iug4ptq4@4ax.com>

On 23 Oct 2001 06:30:08 GMT, rgarciasuarez@free.fr (Rafael
Garcia-Suarez) wrote wonderful things about sparkplugs:

SNIP
>(Java has no support for regexps
SNIP
No longer true there's a REGEX hack for JAVA, supposedly very Perly


--
TMTOWTDI: My way tends to be wrong...
lmoran@wtsg.com


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

Date: 23 Oct 2001 15:09:00 GMT
From: usenet@jasonkohles.com (Jason Kohles)
Subject: Re: Problem installing  lcwa-1.0.0
Message-Id: <slrn9tb1sl.9i9.usenet@poseidon.mediabang.com>

On 23 Oct 2001 08:46:16 GMT, Ben Lowe wrote:
>I have a problem installing the CPAN modules lcwa-1.0.0.

>OS Release: Solaris 8 6/00 s28s_u1wos_08 SPARC
> Kernel Configured: 64-bit
>          Platform: SUNW,Ultra-60
>
>Configuring for LCWA /usr/ucb/cc:  language optional software package not instled
>
The error 'language optional software package not installed' means 'this
machine does not have a compiler'.  You need to install the Sun compiler,
or gcc, or some other compiler, or set the CC environment variable if you
already have one of these installed.

-- 
Jason S Kohles
email@jasonkohles.com          http://www.jasonkohles.com/


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

Date: Tue, 23 Oct 2001 11:48:45 -0500
From: Bing Du <bing-du@tamu.edu>
Subject: SDBM_File size limit?
Message-Id: <3BD59F6D.34BC6D81@tamu.edu>

Running the Perl script attached below returns the following error:

"sdbm store returned -1, errno 22, key "memo" at ./z.cgi line xxx."

Basically, the scripts tries to store a hash with only one key 'memo'
into a SDBM database and then retrieve it right away.  But it failed
when writing.  Seems there is not any problem if the text written is not
very long.

Does SDBM have any size limit on each field?

=============================
#!/usr/local/bin/perl

use SDBM_File;
use Fcntl;

my $memo = <<_TEXT;
<192 lines text here>
_TEXT

$specific{'memo'} = $memo;

print "write the hash to a SDBM file\n";
&SetSessValues(\%specific);

print "retrieve the hash from SDBM\n";
%specific = &GetSessValues;
print "********new memo is ************";
print "$specific{'memo'}";
exit;
sub SetSessValues {
my ($DBMdb) = @_;

my %specific;

   undef %specific;

      # open the session file and set values:

      tie(%specific, 'SDBM_File',"z",Fcntl::O_RDWR()|Fcntl::O_CREAT(),
0644) ||
print "SetSessValues:  Unable to open file for writing ($!).<br>";

      # set the values in the DB to values passed as argument:

        %specific = %$DBMdb;

      # store the new values:

        untie(%specific);
  return;
}

sub GetSessValues {
my (%specific,%returnvalue);

      return unless -e "z.pag";

      tie(%specific, 'SDBM_File', "z", Fcntl::O_RDONLY(),0644) || print
"GetSess
Values: Unable to open file for for reading ($!).<br>";
     %returnvalue = %specific;
     untie %specific;

    return %returnvalue;
}
========================

Thanks for any help,

Bing



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

Date: Tue, 23 Oct 2001 17:53:16 GMT
From: dragnet@internalysis.com (Marc Bissonnette)
Subject: Re: Using a remote file with a Perl script
Message-Id: <Xns91438E46254Ddragnetinternalysisc@207.35.177.134>

Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de> wrote in
news:3BCDC3EC.2000307@post.rwth-aachen.de: 

> Marc Bissonnette wrote:
> 
>> Hi all;
>> 
>> Could someone point me in the right direction to learn how to use the 
>> contents of a file on a remote server in a perl script?
> 
> What do you mean with 'use'? You mean like the use()-function of Perl?

Similar to 'require foo.pl', exept 'foo.pl' would reside on a machine other 
than the one the primary script is running, accessible over the 'net.

>> Specifically, I was thinking of writing a CGI running on a client's
>> server 
> 
> A CGI running on a client's server? I don't quite understand that.

A client as in a customer, or as in a server other than my own :)

I am just curious to know if this is a viable option; ideally:

Write CGI that performs X on server A. This CGI would make a call to remote 
server B for a subroutine that performs Y and returns a result to server A.

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

Marc Bissonnette
InternAlysis
Intelligence in Internet Communications
http://www.internalysis.com


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

Date: Tue, 23 Oct 2001 15:11:37 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Webpage Passwords
Message-Id: <slrn9tavdn.h0i.tadmc@tadmc26.august.net>

Scott Bell <news@scottbell.org> wrote:

>What I wanted to do was write a .cgi script that would output a
                                                  ^^^^^^^^^^^^

The answer to the Perl part of your question is:

   use the print() function to make output.


>header which would cause the browser to ask for a password. 


_What_ should be output is not specific to Perl. If you were
writing your program in C or Visual Basic, what header to
output would be the same.

Since the answer is the same even if you are not using Perl,
then it must not be a Perl-related question.

Once you know what it is that the protocol you are using
requires, then you can try complying with the protocol 
using Perl.

If you can't get _that_ to work, then it _might_ be Perl-related.


>I don't
>understand why people are saying this has nothing to do with perl, 


Because the answer is the same if you happened to be using
any other language.


>the
>webpage is a CGI script written in the perl language.


I have a Perl program to manage my MP3 files.

By your logic above, then this would be on-topic here:

   What is the best song?


Being able to "partition" the problem is a primary fundamental
of troubleshooting. You should try and develop the ability to
do this. It will pay you back in time saved while debugging.

If you get it wrong, you end up looking for the answer in the
wrong place.

"What header makes a pw dialog pop up?" has something to do
with the WWW, so the www.* newsgroups are the place to look
for the answer.



[ Please do not quote in reversed-time order. Text snipped. ]


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Tue, 23 Oct 2001 10:10:42 -0500
From: trammell@haqq.hypersloth.invalid (John J. Trammell)
Subject: Re: What the **** is WRONG with this!?
Message-Id: <slrn9tb23i.np5.trammell@haqq.hypersloth.net>

On Tue, 23 Oct 2001 14:59:00 GMT, Graham W. Boyes <me@REMOVETHIStoao.net> wrote:
> I swear I did this and it worked yesterday.  I'm using a CGI script to make 
> a new directory inside the directory that's inside the directory the script 
> is in.
> 
> system("mkd /home/XXXX/data/forum/data/test");
> 
> /home/XXXX/data/forum is where the script is.  /home/XXXX/data/forum/data is 
> chmoded to 777.
> 
> I am new to Linux (as you will probably guess before you fall out of your 
> chair laughing) so please tell me where I have gone wrong.
> Thanks
> 
What does 'mkd' do?  You mean mkdir?  Is there some reason you're
not using Perl's mkdir()?

-- 
[M]en become civilized, not in proportion to their willingness to believe,
but in proportion to their willingness to doubt.            - H.L. Mencken


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

Date: 23 Oct 2001 15:18:56 GMT
From: usenet@jasonkohles.com (Jason Kohles)
Subject: Re: What the **** is WRONG with this!?
Message-Id: <slrn9tb2f9.9i9.usenet@poseidon.mediabang.com>

On Tue, 23 Oct 2001 14:59:00 GMT, Graham W. Boyes wrote:
>I swear I did this and it worked yesterday.  I'm using a CGI script to make 
>a new directory inside the directory that's inside the directory the script 
>is in.
>
>system("mkd /home/XXXX/data/forum/data/test");
>
>I am new to Linux (as you will probably guess before you fall out of your 
>chair laughing) so please tell me where I have gone wrong.
>Thanks
>
'mkd' is a dos command, you may have an alias that maps 'mkd' to 'mkdir', but
those aliases are not accessible when you use system().  I think you meant
'mkdir'.

-- 
Jason S Kohles
email@jasonkohles.com          http://www.jasonkohles.com/


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

Date: Tue, 23 Oct 2001 15:22:14 GMT
From: "Graham W. Boyes" <me@REMOVETHIStoao.net>
Subject: Re: What the **** is WRONG with this!?
Message-Id: <Xns9143554B14E7E15497002270367234@24.2.10.79>

Jason Kohles, you are hereby charged with writing the following:

> 'mkd' is a dos command, you may have an alias that maps 'mkd' to
> 'mkdir', but those aliases are not accessible when you use system().  I
> think you meant 'mkdir'.

Really?  I would have sworn my FTP program used mkd when it wanted to make a 
directory.  I figured I could use a system command to do the same thing.

Thanks guys, I'll try your suggestions. 


Graham
-- 
Health warning: diet soft drinks, Equal sweetener and NutraSweet contain the 
artificial sweetener Aspartame WHICH CAN CAUSE CANCER, DIABETES, OBESITY, 
EYE DISEASE, PARKINSON'S AND MORE.  Read more here: http://www.dorway.com/




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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 1991
***************************************


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