[17252] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4674 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 20 11:05:33 2000

Date: Fri, 20 Oct 2000 08:05:13 -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: <972054313-v9-i4674@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 20 Oct 2000     Volume: 9 Number: 4674

Today's topics:
        [Kinda Off Topic] Re: capture CTRL-C, CTRL-Z (Gwyn Judd)
        ANNOUNCE: Lingua::EN::Inflect 1.86 (Damian Conway)
    Re: Boolean query to Perl regexp match conversion <randy@theoryx5.uwinnipeg.ca>
    Re: Boolean query to Perl regexp match conversion <sba@ocegr.fr>
    Re: Bug in Date::Calc Day_of_Week <ubl@schaffhausen.de>
    Re: Counter doesn't work <bernie@fantasyfarm.com>
    Re: File::Find pruning <james@NOSPAM.demon.co.uk>
    Re: Finding two words in any order in string? (Randal L. Schwartz)
    Re: Finding two words in any order in string? (Bernard El-Hagin)
    Re: Finding two words in any order in string? <sba@ocegr.fr>
    Re: God, this is like hard work... <themoriman@ntlworld.com>
    Re: God, this is like hard work... (Gwyn Judd)
    Re: Going from Linux RPM Perl 5.00503 to compiled 5.6.0 <scott@lund.com>
    Re: Help DBI/ DBD mysql (Anthony Peacock)
    Re: Help DBI/ DBD mysql (Anthony Peacock)
    Re: Help uploading multiple files <ubl@schaffhausen.de>
        Help!! converting string to packed signed hexadecimal?? yevziig@my-deja.com
    Re: Help!! converting string to packed signed hexadecim <mbudash@sonic.net>
        IPC::Session problem <holeczek@us.edu.pl>
        IPC::Session problem <holeczek@us.edu.pl>
    Re: Newb Question: path variable setting for running Pe <nickco3@yahoo.co.uk>
    Re: Object destructors not working properly? <lesley@natric.demon.co.uk>
    Re: POST into an other cgi script <jeff@vpservices.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 20 Oct 2000 15:00:17 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: [Kinda Off Topic] Re: capture CTRL-C, CTRL-Z
Message-Id: <slrn8v0nft.7rg.tjla@thislove.dyndns.org>

I was shocked! How could JA <jalford12@yahoo.co.uk>
say such a terrible thing:
>incase you don't, like me, have access to perldoc...
>
>#
># set up a signal handler
>#
>$SIG{INT} = \&signal_handler;
>$SIG{TERM} = \&signal_handler;
>$program_stop_flag = 0;

This wont work unfortunately. You need to understand more about how unix
works, and who 'gets' the keystrokes, and what they do with them.
Consider, if the user hits CTRL-Z, the console will get that keystroke
and turn it into a STOP signal, which is not able to be caught or
ignored. You need to do something about what your console does with
these characters. See umm

man stty
man termios

Also my copy of the Camel (2e) has a script that does stuff with setting
the term flags. This is off-topic though.

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Injustice anywhere is a threat to justice everywhere.
		-- Martin Luther King, Jr.


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

Date: 20 Oct 2000 00:43:07 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: ANNOUNCE: Lingua::EN::Inflect 1.86
Message-Id: <sv0h1hcgknmoe0@corp.supernews.com>
Keywords: perl, module, release

==============================================================================
                Release of version 1.86 of Lingua::EN::Inflect
==============================================================================

DESCRIPTION

The exportable subroutines of Lingua::EN::Inflect provide plural
inflections and "a"/"an" selection for English words.

Plural forms of all nouns, most verbs, and some adjectives are
provided. Where appropriate, "classical" variants (for example:
"brother" -> "brethren", "dogma" -> "dogmata", etc.) are also
provided.

Pronunciation-based "a"/"an" selection is provided for all English
words, and most initialisms.

Lingua::EN::Inflect also provides facilities for comparing 
words in a "number-insensitive" manner (that is, an eq-like
comparison in which "ox" and "oxen" compare equal).

In generating these inflections, Lingua::EN::Inflect follows the
Oxford English Dictionary and the guidelines in Fowler's Modern
English Usage, preferring the former where the two disagree.

The module is built around standard British spelling, but is
designed to cope with common American variants as well. Slang,
jargon, and other English dialects are *not* explicitly catered
for. However, the module does provide the ability to define new
plural forms (or redefine existing ones).

Where two or more inflected forms exist for a single word
(typically a "classical" form and a "modern" form), by default
Lingua::EN::Inflect returns the more common form (typically the
"modern" one). The programmer can, however, specify that
"classical" plurals should be preferred.


==============================================================================

CHANGES IN VERSION 1.86


	- Fixed handling of postfix prepositions: "passers-by", etc.

	- Removed superfluous prototyping (thanks Jarkko)

	- Fixed "modification of read-only value" bug

	- Cleaned up for perl 5.6 (thanks Matthew and Brent)

	- Doc tweak (thanks Nathan)

	- Fixed handling of '-ses' -> '-se' verb form

	- Fixed missing handling of PL_ADJ and NUMWORDS in &infect.


==============================================================================

AVAILABILITY

Lingua::EN::Inflect has been uploaded to the CPAN
and is also available from:

	http://www.csse.monash.edu.au/~damian/CPAN/Lingua-EN-Inflect.tar.gz

==============================================================================




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

Date: 20 Oct 2000 13:10:37 GMT
From: Randy Kobes <randy@theoryx5.uwinnipeg.ca>
Subject: Re: Boolean query to Perl regexp match conversion
Message-Id: <8spg8d$c47$1@canopus.cc.umanitoba.ca>

In comp.lang.perl.misc, Stephane Barizien <sba@ocegr.fr> wrote:

> I'm looking for a way to convert a "search engine style" boolean query
> like
> (foo OR bar) AND blah* AND kernel
> into a (set of) equivalent Perl regexp matching operation(s) (assuming
> the entire text to run the query against is in a single
> multiline-thus-with-embedded-newlines Perl $str)

Hi,
    Take a look at the Text::Query::Advanced module, which matches
some text against a boolean expression, similar to an AltaVista
advanced query. See, for example,
http://theoryx5.uwinnipeg.ca/mod_perl/cpan-search?doc=Text::Query::Advanced
for documentation.

best regards,
randy kobes


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

Date: Fri, 20 Oct 2000 16:48:03 +0200
From: Stephane Barizien <sba@ocegr.fr>
To: Randy Kobes <randy@theoryx5.uwinnipeg.ca>
Subject: Re: Boolean query to Perl regexp match conversion
Message-Id: <39F05B23.B160936A@ocegr.fr>

Randy Kobes wrote:
> 
> In comp.lang.perl.misc, Stephane Barizien <sba@ocegr.fr> wrote:
> 
> > I'm looking for a way to convert a "search engine style" boolean query
> > like
> > (foo OR bar) AND blah* AND kernel
> > into a (set of) equivalent Perl regexp matching operation(s) (assuming
> > the entire text to run the query against is in a single
> > multiline-thus-with-embedded-newlines Perl $str)
> 
> Hi,
>     Take a look at the Text::Query::Advanced module, which matches
> some text against a boolean expression, similar to an AltaVista
> advanced query. See, for example,
> http://theoryx5.uwinnipeg.ca/mod_perl/cpan-search?doc=Text::Query::Advanced
> for documentation.
> 
> best regards,
> randy kobes


I'll have a look at that. Thanks.


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

Date: Fri, 20 Oct 2000 13:59:20 +0200
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Bug in Date::Calc Day_of_Week
Message-Id: <39F03398.D74CFD@schaffhausen.de>

Martien Verbruggen schrieb:

> > For Dates before 1980 it seems to deliver the wrong days.
> > I've asked 3 colleages for the day of their birth and had them
> > call their mothers to verify it, and for all of them Date::Calc
> > delivers wrong results.
> 
> Maybe their mothers have a bug? :)

Yes they do;

> 
> > BTW: my Macintosh Date/Time control panel (the Perl script is
> > running on Linux) has similar problems.
> >
> > My Questions are whether:
> > - this is a bug?
> 
> I don't see a bug.
> 
> > - Germany left out a coupla leap years ?-)
> 
> Not to my knowledge.
> 
> > - the US left out a coupla leap years?
> 
> Not to my knowledge.
> 
> > - there are any solutions for this problem? (maybe a small UNIX app)
> 
> as far as I can tell, there is no problem with Date::Calc. Maybe the
> solution is to replace your Mac's date/time control panel, and maybe
> your collegues' mothers :)

I tried to, but my company's lawyers had some objections. Anyway,
everything works
fine now. 

Thanks,

malte


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

Date: Fri, 20 Oct 2000 09:37:51 -0400
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Re: Counter doesn't work
Message-Id: <jfi0vskkqmg6lhcmi0vslqasggaljn1as2@news.supernews.net>

tjla@guvfybir.qlaqaf.bet (Gwyn Judd) wrote:

} I was shocked! How could Ted Zlatanov <tzz@heechee.beld.net>
} say such a terrible thing:

} >The proper approach would be something like this:
} >
} >if (open FILE ...)
} >{
} > # do the file processing
} > close FILE;
} >}
} >else
} >{
} > # handle the error appropriately - die, warn, whatever
} >}
} 
} ick. I *much* prefer it the other way:
} 
} open FILE ... or handle the error however you like it die, warn, open
} another file whatever

Actually, I"m a fence-sitter and think that you're both right: *IF* the
error handling is neat, compact, and fits on a half-line-of-source [which
is all the space you've got left on the line after the 'open'], then I'll
do just as you said:
   open file or [whatever.. ONLY if it fits neatly here].

IF the error processing is harder [e.g., perhaps it includes a directory
search to look for the file, or perhaps it includes extracting the file
from an archive or who knows what], I'll do:

   if (not open FILE)
   {
      lots of code to deal with the error
   }

although I'll usually NOT do an if/then/else --- basically, I straightline
the "the file opened OK" and just if/then to trap the error...

  /Bernie\
-- 
Bernie Cosell                     Fantasy Farm Fibers
bernie@fantasyfarm.com            Pearisburg, VA
    -->  Too many people, too few sheep  <--          


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

Date: Fri, 20 Oct 2000 15:32:07 +0100
From: James Taylor <james@NOSPAM.demon.co.uk>
Subject: Re: File::Find pruning
Message-Id: <ant2014071cbfNdQ@oakseed.demon.co.uk>

In article <e8svuso867tsd4a1qcrhp814c4bkgpoqro@4ax.com>, Bart Lateur
<URL:mailto:bart.lateur@skynet.be> wrote:
> 
> Here's my solution: For every subdirectory, check for the '.overview'
> file yourself. If it exist, set $File::Find::prune in order to skip
> subdirectories.

Yes, thanks. Several people suggested this king of thing.

I really should have thought of it myself I think, but
then I learn something every day. Thanks everyone...

-- 
James Taylor <james (at) oakseed demon co uk>
PGP key available ID: 3FBE1BF9
Fingerprint: F19D803624ED6FE8 370045159F66FD02



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

Date: 20 Oct 2000 07:03:06 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Finding two words in any order in string?
Message-Id: <m17l73pq3p.fsf@halfdome.holdit.com>

>>>>> "Stephane" == Stephane Barizien <sba@ocegr.fr> writes:

>> But if you _must_ do it with one:
>> 
>> $str =~ /^(?=.*foo).*bar/

Stephane> That both works and needs heavy thinking to understand why (usual with
Stephane> Perl regexps... ;-)

Stephane> What about extending to N (>2) words?

    ONCE:
    my $regex = join "", "^(?s)", map "(?=.*?\Q$_\E)", @words;
    $regex = qr/$regex/;
    ...
    AS_NEEDED:
    $found_all = $target =~ $regex;

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: 20 Oct 2000 14:20:58 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Finding two words in any order in string?
Message-Id: <slrn8v0l8c.28m.bernard.el-hagin@gdndev25.lido-tech>

On 20 Oct 2000 07:03:06 -0700, Randal L. Schwartz
<merlyn@stonehenge.com> wrote:
>>>>>> "Stephane" == Stephane Barizien <sba@ocegr.fr> writes:
>
>>> But if you _must_ do it with one:
>>> 
>>> $str =~ /^(?=.*foo).*bar/
>
>Stephane> That both works and needs heavy thinking to understand why (usual with
>Stephane> Perl regexps... ;-)
>
>Stephane> What about extending to N (>2) words?
>
>    ONCE:
>    my $regex = join "", "^(?s)", map "(?=.*?\Q$_\E)", @words;
>    $regex = qr/$regex/;

OK, like, that's way cool.

Cheers,
Bernard
--
perl -le'
($B,$e,$r,$n,$a,$r,$d)=q=$B$e$r$n$a$r$d==~m;
\$(.);xg;print$B.$e.$r.$n.$a.$r.$d;'


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

Date: Fri, 20 Oct 2000 16:44:51 +0200
From: Stephane Barizien <sba@ocegr.fr>
To: "Randal L. Schwartz" <merlyn@stonehenge.com>
Subject: Re: Finding two words in any order in string?
Message-Id: <39F05A63.77B8330E@ocegr.fr>

"Randal L. Schwartz" wrote:
> 
> >>>>> "Stephane" == Stephane Barizien <sba@ocegr.fr> writes:
> 
> >> But if you _must_ do it with one:
> >>
> >> $str =~ /^(?=.*foo).*bar/
> 
> Stephane> That both works and needs heavy thinking to understand why (usual with
> Stephane> Perl regexps... ;-)
> 
> Stephane> What about extending to N (>2) words?
> 
>     ONCE:
>     my $regex = join "", "^(?s)", map "(?=.*?\Q$_\E)", @words;
>     $regex = qr/$regex/;
>     ...
>     AS_NEEDED:
>     $found_all = $target =~ $regex;

Cool, but I'll just keep the (?=.*word) concept, as my patterns are
anyway stored in a text file (one pattern per line).

Thx.


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

Date: Fri, 20 Oct 2000 14:07:22 +0100
From: "The Moriman" <themoriman@ntlworld.com>
Subject: Re: God, this is like hard work...
Message-Id: <UrXH5.643$Rk5.9337@news2-win.server.ntlworld.com>

Bernard

The part of the code that I'm trying to fix takes it's input from 2 text
files. Do you mind if I email you the complete code and text files (all
unneccesary stuff has been cut out so the whole thing is only 4Kb) to see
what you think. If you look and tell me it's working I'll just go ahead and
shoot myself.

Thanks

TMMan




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

Date: Fri, 20 Oct 2000 15:02:27 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: God, this is like hard work...
Message-Id: <slrn8v0nk0.7rg.tjla@thislove.dyndns.org>

I was shocked! How could The Moriman <themoriman@ntlworld.com>
say such a terrible thing:
>Bernard
>
>The part of the code that I'm trying to fix takes it's input from 2 text
>files. Do you mind if I email you the complete code and text files (all
>unneccesary stuff has been cut out so the whole thing is only 4Kb) to see
>what you think. If you look and tell me it's working I'll just go ahead and
>shoot myself.

I think I know what you missed. Lemme guess:

perldoc -f chomp

Hope that helps. :)

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
	"Hawk, we're going to die."
	"Never say die... and certainly never say we."
		-- M*A*S*H


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

Date: Fri, 20 Oct 2000 07:19:34 -0700
From: Scott Chapman <scott@lund.com>
Subject: Re: Going from Linux RPM Perl 5.00503 to compiled 5.6.0 - libraries are not in @INC now!  Help!
Message-Id: <btk0vsgr1k2hpuhtm47p6kv8nieplot3oh@4ax.com>

On Fri, 20 Oct 2000 01:04:52 +0200, Anders Lund <anders@wall.alweb.dk>
wrote:

>Scott Chapman wrote:
>
>> I've seen this a number of times when I've started on a RPM version of
>> Perl and later compile the latest version and install it.  My @INC is
>> not current and some programs complain like this:
>> 
>> >Can't locate strict.pm in @INC (@INC contains:
>> >/usr/lib/perl5/5.00503/i386-linux
>> > /usr/lib/perl5/5.00503 /usr/lib/perl5/site_perl/5.005/i386-linux
>> > /usr/lib/perl5
>> >/site_perl/5.005 .) at ./Configure line 9.
>> 
>> strict is now located in:
>> /usr/local/lib/perl5/5.6.0/strict.pm
>> 
>> How do I straighten out this mess?
>
>Did you uninstall the rpm's? Most rpm packages should have scripts to clean 
>up your system when you uninstalls them.
>
If I uninstalled the old version, It would not remove my old
/usr/lib/perl5/5.00503 /usr/lib/perl5/site_perl/5.005/i386-linux (and
other) directories would it?  They have other files in them from pod's
I've fetched off CPAN that the RPM system doesn't know about.

I've often wondered if I should reinstall all my pods from cpan, etc.
when I upgrade Perl as well so that they get put in the correct tree
structure.  (It would be nice if they were installed in a generic tree
structure, rather than perl-version specific, if they can be used
across perl versions).

How do you Perl guru's deal with this?


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

Date: 20 Oct 2000 13:37:29 GMT
From: a.peacock@chime.ucl.ac.uk (Anthony Peacock)
Subject: Re: Help DBI/ DBD mysql
Message-Id: <8sphqp$n1u$1@uns-a.ucl.ac.uk>

In article <8sp4fm$olr$1@nnrp1.deja.com>, ghorghor@my-deja.com says...
>
>In article <39f00dfc.11215704@news.internord.dk>,
>  a_hertz@removethis.yahoo.com (Anders Hertz) wrote:
>> On Fri, 20 Oct 2000 07:59:05 GMT, ghorghor@my-deja.com wrote:
>>
>> >> NOTA : the IP is correct, the user tut have privileges on database
>> >with
>> >> host : IP of my primary serveur
>> >> the password is correct
>>
>> I am no expert either but should'nt host be the server running mySql ?
>>
>> >>
>> >i modifie some code
>> >$dbh = DBI->connect("dbi:$driver:$datasource", $username, $password)
>or
>> >die "Can't connect to mysql database: $DBI::errstr\n";
>> >
>> >and i have this now :
>> >Can't connect to mysql database: Unknown MySQL Server Host
>> >(host=216.MMM.MMM.MMM)(0)
>>
>> Anders
>>
>connection telnet to port 3306 ( mysql )
>on the DB serveur work
>so there isn't a pb of communication
>
>i have test that on an other machine and it works
>so it seems to be the DBD versions that doesn't work
>
>but i have an old version of perl 5.0004
>and DBI : 0.93
>
>but i can't install a new version of perl for compatibility
>and i not sure that installing a new version of with old perl will
>work ??


Another possiblity is due to versions of mySQL.  

What version of mySQL is running on the server?  
What version of mySQL was your DBD module built with?

If the two are not of the same major version than you may experience 
problems.



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

Date: 20 Oct 2000 13:38:40 GMT
From: a.peacock@chime.ucl.ac.uk (Anthony Peacock)
Subject: Re: Help DBI/ DBD mysql
Message-Id: <8spht0$n1u$2@uns-a.ucl.ac.uk>

In article <8sphqp$n1u$1@uns-a.ucl.ac.uk>, a.peacock@chime.ucl.ac.uk 
says...
>
>In article <8sp4fm$olr$1@nnrp1.deja.com>, ghorghor@my-deja.com says...
>>
>>In article <39f00dfc.11215704@news.internord.dk>,
>>  a_hertz@removethis.yahoo.com (Anders Hertz) wrote:
>>> On Fri, 20 Oct 2000 07:59:05 GMT, ghorghor@my-deja.com wrote:
>>>
>>> >> NOTA : the IP is correct, the user tut have privileges on database
>>> >with
>>> >> host : IP of my primary serveur
>>> >> the password is correct
>>>
>>> I am no expert either but should'nt host be the server running mySql ?
>>>
>>> >>
>>> >i modifie some code
>>> >$dbh = DBI->connect("dbi:$driver:$datasource", $username, $password)
>>or
>>> >die "Can't connect to mysql database: $DBI::errstr\n";
>>> >
>>> >and i have this now :
>>> >Can't connect to mysql database: Unknown MySQL Server Host
>>> >(host=216.MMM.MMM.MMM)(0)
>>>
>>> Anders
>>>
>>connection telnet to port 3306 ( mysql )
>>on the DB serveur work
>>so there isn't a pb of communication
>>
>>i have test that on an other machine and it works
>>so it seems to be the DBD versions that doesn't work
>>
>>but i have an old version of perl 5.0004
>>and DBI : 0.93
>>
>>but i can't install a new version of perl for compatibility
>>and i not sure that installing a new version of with old perl will
>>work ??
>
>
>Another possiblity is due to versions of mySQL.  
>
>What version of mySQL is running on the server?  
>What version of mySQL was your DBD module built with?
>
>If the two are not of the same major version than you may experience 
>problems.
>


PS I still think you will get more help if you ask this question on the 
mySQL mailing list.



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

Date: Fri, 20 Oct 2000 16:47:20 +0200
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Help uploading multiple files
Message-Id: <39F05AF7.EF31DDA9@schaffhausen.de>

Jon Hanna schrieb:
> 
> I'm new to perl, but I've had pretty good luck modifying the Upscreens
> script. Everything works fine, but I do have one question.
> 
> My form currently allows up to 5 jpg files to be uploaded, however the
> script only recognizes the first file. Any way to modify the script so
> it recognizes all 5 files from the upload fields? Maybe something to do
> with the "$onnum != 11" or the "my $file" lines?
> 
> My script is pasted below. Thanks for any help!

Looks like this script is trying to download 10 Files
with the form field names: FILE1 ... FILE10







> 
> ############# -->
> # Upload Data
> 
> use CGI;
> $onnum = 1;
> while ($onnum != 11) {
> my $req = new CGI;
> my $file = $req->param("FILE$onnum");
> $descr = $req->param("descr");
> $year = $req->param("year");
> $persurl = $req->param("persurl");
> $persweb = $req->param("persweb");
> $location = $req->param("location");
> $persname = $req->param("persname");
> $persemail = $req->param("persemail");
> if ($file ne "") {
> my $fileName = $file;
> $fileName =~ s!^.*(\\|\/)!!;
> $newmain = $fileName;
> if ($allowall ne "yes") {
> if (lc(substr($newmain,length($newmain) - 4,4)) ne $theext){
> $filenotgood = "yes";
> }
> }
> if ($filenotgood ne "yes") {
> open (OUTFILE, ">$basedir/$fileName");
> print "$basedir/$fileName<br>";
> while (my $bytesread = read($file, my $buffer, 1024)) {
> print OUTFILE $buffer;
> }
> close (OUTFILE);
> }
> }
> $onnum++;
> }
> 
> ############## -->
> # Data to Page
> 
>    open(MAIN,"$htmldir") || die $!;
>    @main = <MAIN>;
>    close(MAIN);
> 
>    open(MAIN,">$htmldir") || die $!;
>    if ($followup == 0) {
>       foreach $main_line (@main) {
>          if ($main_line =~ /<!--begin-->/) {
>             print MAIN "<!--begin-->\n";
>             print MAIN "<!-- ______GALLERY ITEM BEGIN______ -->\n";
>             print MAIN "  <div align=center><a href=$picurl/
> $newmain><img width=100 src=$tnurl/tn_$newmain></a>\n";
>             print MAIN "<table border=0 cellpadding=0 cellspacing=0
> width=650 bgcolor=#002828>\n";
>             print MAIN " <tr>\n";
>             print MAIN " <td bgcolor=#7C7352 colspan=2 height=6><img
> height=1 src=http://californiaspecial.com/images/sg-clear.gif
> width=10></td>\n";
>             print MAIN " </tr>\n";
>             print MAIN " <tr>\n";
>             print MAIN " <td bgcolor=#000000 align=left valign=top
> width=50%>\n";
> 
>             print MAIN "<table border=0 cellpadding=3 cellspacing=2
> width=325 bgcolor=#002828>\n";
>             print MAIN " <tr>\n";
>             print MAIN "  <td bgcolor=#000000 align=left valign=top
> width=50%><font color=#AE9F80 size=-1><b>YEAR: </b></font><font size=-
> 1>$year</font></td>\n";
>             print MAIN " </tr>\n";
>             print MAIN " <tr>\n";
>             print MAIN "  <td bgcolor=#000000 align=left
> valign=top><font color=#AE9F80 size=-1><b>OWNER: </b></font><font size=-
> 1>$persname</font></td>\n";
>             print MAIN " </tr>\n";
>             print MAIN " <tr>\n";
>             print MAIN "  <td bgcolor=#000000 align=left
> valign=top><font color=#AE9F80 size=-1><b>LOCATION: </b></font><font
> size=-1>$location</font></td>\n";
>             print MAIN " </tr>\n";
>             print MAIN " <tr>\n";
>             print MAIN "  <td bgcolor=#000000 align=left
> valign=top><font color=#AE9F80 size=-1><b>E-MAIL: </b></font><font
> size=-1><a href=mailto:$persemail>$persemail</a></font></td>\n";
>             print MAIN " </tr>\n";
>             print MAIN " <tr>\n";
>             print MAIN "  <td bgcolor=#000000 align=left
> valign=top><font color=#AE9F80 size=-1><b>WEB PAGE: </b></font><font
> size=-1><a href=$persurl>$persweb</a></font></td>\n";
>             print MAIN " </tr>\n";
>             print MAIN "</table>\n";
>             print MAIN " </td>\n";
> 
>             print MAIN " <td bgcolor=#000000 align=left valign=top
> width=50%>\n";
>             print MAIN "<table border=0 cellpadding=3 cellspacing=2
> width=325 bgcolor=#002828>\n";
>             print MAIN " <tr>\n";
>             print MAIN "  <td bgcolor=#000000 align=left
> valign=top><font color=#AE9F80 size=-1><b>FEATURES: </b></font><font
> size=-1>$descr</font></td>\n";
>             print MAIN " </tr>\n";
>             print MAIN "</table>\n";
> 
>             print MAIN " </td>\n";
>             print MAIN " </tr>\n";
>             print MAIN "</table>\n";
>             print MAIN "<p>\n";
>             print MAIN "<br>\n";
>             print MAIN "<p>\n";
>             print MAIN "<!-- ______GALLERY ITEM END______ -->\n";
>          }
>          else {
>             print MAIN "$main_line";
>          }
>       }
>       close(MAIN);
>    }
> 
> ################# -->
> # After Data Code
> 
> print "Content-type: text/html\n";
> print "Location:$back\n\n";
> 
> # End of Script
> ###############
> 
> ###################### -->
> # Grabs info from form
> 
> if ($FORM{'descr'} =~ /.*\@.*\..*/) {
>    $descr = "$FORM{'descr'}";
>    $descr =~ s/\&/\&amp\;/g;
>    $descr =~ s/"/\&quot\;/g;
> }
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.


-- 
$me = Person->new("Malte Ubl");
$me->comp ("Schaffhausen | Interactive");
$me->job  ("Developer for web-based Applications");
$me->phone("+49 4121 472964");
$me->fax  ("+49 4121 472938");
exit; # reference count = 0 -> $me->DESTROY


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

Date: Fri, 20 Oct 2000 13:16:08 GMT
From: yevziig@my-deja.com
Subject: Help!! converting string to packed signed hexadecimal??
Message-Id: <8spgii$1p9$1@nnrp1.deja.com>

I need to convert a short string to packed-signed
hexadecimal.

Anybody have a clue as of how to do it in Perl?

Any help is appreciated.

Thank you very much.




Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 20 Oct 2000 06:39:47 -0700
From: Michael Budash <mbudash@sonic.net>
Subject: Re: Help!! converting string to packed signed hexadecimal??
Message-Id: <mbudash-6A661A.06394720102000@news.pacbell.net>

In article <8spgii$1p9$1@nnrp1.deja.com>, yevziig@my-deja.com wrote:

> I need to convert a short string to packed-signed
> hexadecimal.
> 
> Anybody have a clue as of how to do it in Perl?
> 
> Any help is appreciated.
> 
> Thank you very much.
> 

ooooo, you're so close already...

check out perl's 'pack' and 'unpack'

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


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

Date: Fri, 20 Oct 2000 15:05:44 +0200
From: "Jacek M. Holeczek" <holeczek@us.edu.pl>
Subject: IPC::Session problem
Message-Id: <Pine.SOL.4.21.0010201505170.21489-100000@uranos.cto.us.edu.pl>

Hi,
I try to use the IPC::Session, (version 0.03) but ... :
	my $session = new IPC::Session("rsh mymachine",30);
returns :
	timeout on stderr at /usr/lib/perl5/site_perl/5.005/IPC/Session.pm line 88.
What is wrong ?
Thanks in advance,
Jacek.



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

Date: Fri, 20 Oct 2000 16:16:35 +0200
From: "Jacek M. Holeczek" <holeczek@us.edu.pl>
Subject: IPC::Session problem
Message-Id: <Pine.SOL.4.21.0010201616190.4222-100000@uranos.cto.us.edu.pl>

Hi,
I just realized that IPC::Session breaks in "send" not in "new". Sorry for
my previous mail. Here is a modified version

I try to use the IPC::Session, (version 0.03) but ... :
	print "Before new\n";
	my $session = new IPC::Session("rsh mymachine",30);
	print "After new\n";
	$session->send("hostname");  # run `hostname` command on scramjet
	print "After send hostname\n";
returns :
	Before new
	After new
	Uncaught exception from user code:
        timeout on stderr at /usr/lib/perl5/site_perl/5.005/IPC/Session.pm line 88.
        IPC::Session::__ANON__('timeout on stderr') called at /usr/lib/perl5/site_perl/5.005/IPC/Session.pm line 159
        IPC::Session::send('IPC::Session=HASH(0x80c8554)', 'hostname;') called at ./p3.pl line 13
	timeout on stderr at /usr/lib/perl5/site_perl/5.005/IPC/Session.pm line 88.
What is wrong ?
Thanks in advance,
Jacek.



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

Date: Fri, 20 Oct 2000 14:47:21 +0100
From: Nick Condon <nickco3@yahoo.co.uk>
Subject: Re: Newb Question: path variable setting for running Perl from Dos  prompt
Message-Id: <39F04CE8.20327EF1@yahoo.co.uk>

Wade \"Boomer\" VanderBoom wrote:

> After installing activestate perl, system will run perl scripts through
> windows, but chaning to DOS prompt to run the perl script with appropriate
> "perl script.plx" it defaults to bad command.
>
> man pages mention something about a "shebang" bat, can anyone explain?

On many Unixes, scripts carry an identifier in the first line that tells the
OS what application to associate with the script and what flags to run it
with, e.g.:

#!/usr/local/bin/perl -w
print "Hello world\n";

 ... invokes /usr/local/bin/perl with the (w)arnings flag on. The first 2
characters '#!' and this method generally, are commonly referred to as the
shebang.

I've no idea how this might translate to Windows, which I believe does not use
this convention. As far as you're concerned it's probably a red herring.



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

Date: Fri, 20 Oct 2000 14:41:48 +0100
From: "Lesley Withall" <lesley@natric.demon.co.uk>
Subject: Re: Object destructors not working properly?
Message-Id: <972049286.23245.0.nnrp-14.9e989efa@news.demon.co.uk>

I have now eliminated the double reference equivalent to  One->Subone in the
example below and it still goes wrong... the last object to be destroyed
still no longer has the sub-reference within it.


"lesley withall" <lesley@natric.demon.co.uk> wrote in message
news:972033502.17625.0.nnrp-14.9e989efa@news.demon.co.uk...
> Well the problem is it doesn't go wrong in a simple script...
>
> this is essentially what I have (although this works)
>
> package One;
> use ObjectTemplate;
> @ISA = qw(ObjectTemplate);
>
> attributes qw(SubOne SubTwo);
>
> sub DESTROY
> {
> my $self = shift;
> print "in One DESTROY " . $self->SubOne->Testone;
> }
> package Two;
> use ObjectTemplate;
> @ISA = qw(ObjectTemplate);
>
> attributes qw(SubThree);
>
> sub DESTROY
> {
> my $self = shift;
> print "in Two DESTROY" . $self->SubThree->Testone;
> }
> package Subone;
> use ObjectTemplate;
> @ISA = qw(ObjectTemplate);
>
> attributes qw(Testone);
>
> package main;
>
> my $one = new One;
> my $two = new Two;
> $one->SubOne(Subone->new);
> $two->SubThree($one->SubOne);
>
> $one->SubTwo($two);
> $one->SubOne->Testone("ONE");
>
> print $one->SubOne->Testone;
> print $two->SubThree->Testone;
> print $one->SubTwo->SubThree->Testone;
>
> On the actual system (which is large and complex) when it gets to the
> equivalent of my package Two DESTROY method, the reference to the Subone
> object has gone and I can't find anything that gets rid of it explicitly.
It
> feels like a timing problem to me... hence my original question... has
> anyone else had problems? and should references to contained objects still
> be around by the time it gets to the Destroy method of the container?
>
> Thanks for your help.
>
> "Darren Dunham" <ddunham@redwood.taos.com> wrote in message
> news:lvHH5.683$YR.41630@news.pacbell.net...
> > lesley withall <lesley@natric.demon.co.uk> wrote:
> > > Has anyone had problems with object destructors? According to the
> excellent
> > > 'Programming Perl' - 'When the last reference to an object goes away,
> the
> > > object is automatically destroyed. '
> >
> > > My experience is that the object is destroyed when the first reference
> is
> > > deleted. I don't know how to debug this.. any ideas?
> >
> > We don't know what you're doing.  Perhaps a short example that
> > demonstrates what you're having trouble with would help.  Could you post
> > one?
> >
> > --
> > Darren Dunham                                           ddunham@taos.com
> > Unix System Administrator                    Taos - The SysAdmin Company
> > Got some Dr Pepper?                           San Francisco, CA bay area
> >       < Please move on, ...nothing to see here,  please disperse >
>
>




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

Date: Fri, 20 Oct 2000 07:38:29 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: POST into an other cgi script
Message-Id: <39F058E5.D9B5BF9A@vpservices.com>

"Jørgen Teunis" wrote:
> 
> <nobull@mail.com> schreef in bericht news:u91yxbq4an.fsf@wcl-l.bham.ac.uk...
> > "Jørgen Teunis" <jorgen@bos.nl> writes because he's too lazy to read:
> >
> > > I need to do a post into an other script. (kind of fake post)
> >
> > This question is asked here every [expletive-deleted] day.  Sometimes
> > more often.
> >
> > perldoc lwpcook
> >
> > Please see also, the answers that were given to this question
> > yesterday, or the day before, or the day before that, or the day
> > before that...
> 
> Thanks mate....... but.... i don't think you read it yourself but only read
> the word POST and toke you're own conclusions or i didn't ask my question
> the right way...

No.  He understood perfectly well what you are asking.  And the answer
is the LWP module which is documented in lwpcook, the LWP cookbook.  LWP
is the Library for WWW Perl and is the way one posts form info from one
script to another, exactly what you were asking.

> GET THE IDEA???? I didn't saw a question of this type....

Then you didn't look very hard, it is asked here all the time.

-- 
Jeff


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

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


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