[10653] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4245 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 18 07:07:15 1998

Date: Wed, 18 Nov 98 04:00:20 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 18 Nov 1998     Volume: 8 Number: 4245

Today's topics:
    Re: "diff camel pod"? (better: comm -13 camel pod)? <merlyn@stonehenge.com>
    Re: $ENV uninitialized error (Bart Lateur)
        Changing defaults defined in other file (Anneke Treep)
    Re: Changing defaults defined in other file (Sam Holden)
    Re: file type? <sasho@staff.mgu.bg>
    Re: Holy Abounding Books, Batman! (Ilya Zakharevich)
        How to use "format" instruction into a loop ? <klootch@wanadoo.fr>
    Re: How to use "format" instruction into a loop ? <lbenfie1@nospamford.com>
    Re: Intermediate Perl questions (Bart Lateur)
    Re: Intermediate Perl questions dave@mag-sol.com
        Job: Lund, Sweden Lars.Nooden@fake.address.lub.lu.se
        MacPerl + Resource Fork <eva_spiral@hotmail.com>
    Re: NT4 - SP4 affects perl and desktop menu? <matt@teamamiga.org_NOSPAM>
    Re: Perl Usage Survey - interpretations, anyone? <matt@teamamiga.org_NOSPAM>
        Possible bug in "sort" huntersean@hotmail.com
    Re: Possible bug in "sort" (Sam Holden)
    Re: Somthink don`t know~!PLS Help me <sasho@staff.mgu.bg>
    Re: Somthink don`t know~!PLS Help me <tonyt@hknet.com>
    Re: Substitution Grief <prauz@sprynet.com>
    Re: Trouble creating a new file <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: Two-Part RE question <dgris@moiraine.dimensional.com>
    Re: Two-Part RE question (Ilya Zakharevich)
    Re: Two-Part RE question <uri@sysarch.com>
    Re: Two-Part RE question <dgris@moiraine.dimensional.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Wed, 18 Nov 1998 11:27:12 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: "diff camel pod"? (better: comm -13 camel pod)?
Message-Id: <8cg1bhgs1n.fsf@gadget.cscaper.com>

>>>>> "David" == David Combs <dkcombs@netcom.com> writes:

David> So, is there any list of the PARTS of the pod that are NOT
David> covered (identically?  as well as?) by the camel.

Yes.  We had to cut it off somewhere. :) Mostly the stuff about
embedding, because there wasn't time to give it completely decent
coverage.  "Deadlines and commitments -- what to leave in, what to
leave out."

This was sad, because the pink camel was deliberately *more* than the
online documentation for perl 4.000 (although 4.003 was current at the
time of the camel's release).  The blue camel would have been about
25% larger than it turned out had we even merely done the PODs, and as
Tom posted here earlier, the old pink camel as updated is really now
best represented as the new blue camel + the Perl Cookbook + anything
from perlembed that we had to leave out (plus the source to the yacc
syntax file that didn't survive).

David> For it would be VERY NICE INDEED to know what PARTS of the
David> pod that were "required" reading -- surely for things NEWER
David> than are in the camel, plus things that are discussed just
David> plain differently (maybe even better?)

The blue camel was based on 5.003 (or 5.002 since it was just a
security patch difference).  You could pull 5.003 off the CPAN, and
diff the PODs yourself with whatever version of Perl you're running or
plan to run.

I suppose it would be no surprise if I were to suggest that we're very
clear that the camel needs updating again. :) Heck, even the llama
could use a tweak or six.

print "Just another Perl book hacker,"

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Wed, 18 Nov 1998 08:20:31 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: $ENV uninitialized error
Message-Id: <3657827c.5490412@news.skynet.be>

Uri Guttman wrote:

> in general don't use
>defined on hashes since the key may exist and have a value of undef.

The reverse. :-)

If $ENV{PATH_INFO} exists, but it's not defined, you'll STILL get the
warning. AS a prevention of that warning, this sucks (to paraphrase
B&B).

	Bart.


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

Date: 18 Nov 1998 10:26:45 GMT
From: anneke@echelon.nl (Anneke Treep)
Subject: Changing defaults defined in other file
Message-Id: <3xvOrducOdpb-pn2-LIwrWcVvS9Oj@compaa.echelon.nl>

Hi folks,

I am writing script that uses defaults from another file, but should 
also be able
to override these. But somehow it doesn't work yet - the value 7 is 
still being
used.. What am I doing wrong??

file1 - the main script ====================================

use strict;
use vars qw($value);
use mylib;

# Changing defaults
$mylib::value = 6;            # delete this line if you need the 
default value

somefunc();
 ..

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

file2 - my library module =================================

package mylib;

use Exporter ();
@ISA         = qw(Exporter);
@EXPORT      = qw(value  somefunc);
@EXPORT_OK   = qw();
%EXPORT_TAGS = ();

my $value = 7;

sub somefunc {
       # use the $value variable
}
 ..

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

I hope some of you can provide me with a solution - thanks!
--
Anneke Treep                                 | email:     
anneke@echelon.nl
                                             | web:          
www.echelon.nl
ECHELON consultancy and software development | phone:   +31 (0)53 48 
36 585
PO Box 545, 7500AM Enschede, The Netherlands | fax:     +31 (0)53 43 
36 222



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

Date: 18 Nov 1998 11:39:47 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Changing defaults defined in other file
Message-Id: <slrn755cg3.j32.sholden@pgrad.cs.usyd.edu.au>

On 18 Nov 1998 10:26:45 GMT, Anneke Treep <anneke@echelon.nl> wrote:
>Hi folks,
>
>I am writing script that uses defaults from another file, but should 
>also be able
>to override these. But somehow it doesn't work yet - the value 7 is 
>still being
>used.. What am I doing wrong??
>
>file1 - the main script ====================================
>$mylib::value = 6;            # delete this line if you need the 
>
>file2 - my library module =================================
>my $value = 7;

$mylib::value is not the same as 'my' $value inside the mylib package.

Lexical variables (created with my) can not be accessed from outside of the
scope they are created in (unless references are passed out of course). I'm
sure some perl hacker will now explain how to do just that, and I would be 
pleased to learn how if they choose too...

If you want a package global that can be accessed from outside the package 
then don't use lexical variables (or provide access subs).

So change my $value = 7 to just $value = 7 (and add $value to your use vars
list if required)

-- 
Sam

You are bordering on ridiculous if you think you need to support your
premises.  Such an argument is an infinite regression.
 	--George Reese in <wv0O1.1521$Ge.4809664@ptah.visi.com>


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

Date: Wed, 18 Nov 1998 07:56:55 +0200
From: Alexander Avtanski <sasho@staff.mgu.bg>
Subject: Re: file type?
Message-Id: <365261A7.172AA5D4@staff.mgu.bg>


--------------81A9D8A81DE09EA8F4BA7827
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I have no better idea, than using the "file" command:

  $filetype=`file $filename`;

--
Alexander Avtanski
sasho@staff.mgu.bg



--------------81A9D8A81DE09EA8F4BA7827
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
I have no better idea, than using the "file" command:
<p>&nbsp; $filetype=`file $filename`;
<pre>--
Alexander Avtanski
sasho@staff.mgu.bg</pre>
&nbsp;</html>

--------------81A9D8A81DE09EA8F4BA7827--



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

Date: 18 Nov 1998 06:26:15 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Holy Abounding Books, Batman!
Message-Id: <72tpa7$h8q$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Erik
<eln@cyberhighway.net>],
who wrote in article <72t0l4$kca$1@news.cyberhighway.net>:
> You have failed to include exact solutions to every conceivable programming
> problem a person might have, and have in several instances used words
> containing more than two syllables.  You should be ashamed.

Well, at least the first flaw is fixed in the PeCooBoo.  I suspect a
marketing trick with the PP book: warp people minds into *wishing* for
all these solutions while they read PP, and then force them to by yet
another book.  Shame on the Or(w)eillean Perlers!

Ilya


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

Date: Wed, 18 Nov 1998 11:25:55 +0100
From: Serge <klootch@wanadoo.fr>
Subject: How to use "format" instruction into a loop ?
Message-Id: <3652A0B3.2DE8@wanadoo.fr>

hi !



I need to modify the folowing loop ( This is part of Formmail program)


      foreach $value (keys %FORM) {
         # Print the name and value pairs in FORM array to html.
            print MAIL "$value: $FORM{$value}\n\n";
        }

The output of this give a very bad looking (format is text). 
Because the size of name and size of value are very diffirent.
I've tried to introduce some tabs \t\t\t, looks little better.

May i use "format" instruction ?

How I can insert it in the loop ?

to get something like:

Name     :                Value
Naaaaame :                Val
nam      :                Vaaaaaallllluuueee


Thanks in advance. 
Serge.


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

Date: Wed, 18 Nov 1998 11:04:42 +0000
From: Lee Benfield <lbenfie1@nospamford.com>
Subject: Re: How to use "format" instruction into a loop ?
Message-Id: <3652A9CA.2C67@nospamford.com>

Serge wrote:
> =

> hi !
> =

> I need to modify the folowing loop ( This is part of Formmail program)
> =

>       foreach $value (keys %FORM) {
>          # Print the name and value pairs in FORM array to html.
>             print MAIL "$value: $FORM{$value}\n\n";
>         }
> =

> The output of this give a very bad looking (format is text).
> Because the size of name and size of value are very diff=E9rent.
> I've tried to introduce some tabs \t\t\t, looks little better.
> =

> May i use "format" instruction ?
> =


Though there's bound to be a more perlesque (*grin*) answer,
coming from a C background I'd be tempted to use:

printf("%-20.20s%-20.20s\n",$value,$FORM{$value});

in the loop.


-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=
=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D
Lee A Benfield, Ford Motor Co. | The above are my opinions alone.
                               | I couldn't afford better ones...


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

Date: Wed, 18 Nov 1998 08:20:29 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: Intermediate Perl questions
Message-Id: <3656808d.4995648@news.skynet.be>

Sam Holden wrote:

>>In <72s5sg$rab$1@hades.rz.uni-sb.de> "Markus Kaiser" <m.kaiser@sz-sb.de> writes:
>>
>>>looking 4 a efficient way to look at each char of a string.
>>>At the moment I'm using substr( $_, -1, 1 ) in a while loop
>>>and of course regexp would be possible too.
>>>But I'm curious: Is there a better (means faster) way ?
>
>I missed the first post. Surely 'substr( $_, -1, 1 )' returns the last
>character in the string, so I assume you then delete that character,
>or am I completely wrong???

I think so too.

Hey, Markus, if you want to go backwards through the string, use chop.
If you want to go forward, use split //.

	Bart.


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

Date: Wed, 18 Nov 1998 09:33:34 GMT
From: dave@mag-sol.com
Subject: Re: Intermediate Perl questions
Message-Id: <72u49e$jqb$1@nnrp1.dejanews.com>

In article <72s5sg$rab$1@hades.rz.uni-sb.de>,
  "Markus Kaiser" <m.kaiser@sz-sb.de> wrote:
> Hi there,
>
> looking 4 a efficient way to look at each char of a string.
> At the moment I'm using substr( $_, -1, 1 ) in a while loop
> and of course regexp would be possible too.
> But I'm curious: Is there a better (means faster) way ?

Try splitting the string into an array with one character in each array
element.

my @string = split(//, $string);

hth,

Dave...

--
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 18 Nov 1998 07:59:23 GMT
From: Lars.Nooden@fake.address.lub.lu.se
Subject: Job: Lund, Sweden
Message-Id: <72tuor$5k3$2@news.lth.se>
Keywords: programming, search engines, Lund, Sweden, Denmark

NetLab svker 2 programmerare, 
heltid fvr projektanstdllning ett er med ev fvrldngning

Ref nr 13685-98 som dr lockade av att: 

 *  programmera i UNIX-miljv 
 *  jobba i projektform, med eget ansvar och 
    i internationell samverkan gvra grafiska anvdndargrdnsnitt 

Vi svker en kreativ programmerare som har en hvgskoleutbildning 
i programmering, speciellt objectorienterad utveckling och ha god
erferenhet av att programmera i negot av spreken Java, C++, C eller 
Perl. Du bvr ockse ha kunskap om WWW, HTML-kodning,
CGI-programmering och ndtverk som Internet. Det dr meriterande
med kunskap om UNIX samt databaser speciellt i ndtverksmiljv. 

Vi driver flera projekt som behandlar insamling och indexering av
resurser pe ndtet, dels automatiskt genererade index, dels
kvalitetskontrollerade databaser. Vi driver projekt som behandlar
utveckling av metadata och dr starkt involverade i det internationella 
samarbetet inom denna utveckling. Vi arbetar ockse med tekniker fvr att 
gvra olika databaser svkbara fren ett och samma grdnssnitt och med att 
skrdddarsy informationstjdnster fvr olika melgrupper.

Fvr ytterligare information om oss och vera projekt, 
se NetLabs hemsida: http://www.lub.lu.se/netlab/, eller kontakta 
avdelningschefen Anna Br|mmer (anna.brummer@lub.lu.se) 
tel. +46 46 222 01 14 samt fackliga fvretrddare Ann-Sofie Zettergren, 
SACO, +46 46 222 40 08 och Gunnel Petersson, TCO-OFR/S, +46 46 222 92 
15.

Ansvkan, med angivande av referensnummer, etfvljd av meritfvrteckning, 
betygsavskrifter och de handlingar i vvrigt som
svkanden vnskar eberopa, stdlls till Lunds Universitet och skall vara 
inkommet till:

	registrator
	Box 117
	SE-221 00 Lund
	SWEDEN 

---------

NetLab dr Lunds universitietsbilioteks utvecklingsavdelning och vi 
arbetar med olika utvecklingsprojekt inom omredena digitala
biblioteket och ndtbaserad informationsfvrsvrjning i 
Internet/WWW-miljv. Vi driver en rad projekt, sevdl nationella som 
internationella och har ett utvecklat samarbete med 
utvecklingsavdelningen vid Danmarks Tekniske Universitet. Idag dr vi ca 
15 stycken, blandat tjejer och killar med en medelelder pe 35, och vi 
behvver bli fler!!
----- 
(remove fake.address. from the host name to reply)


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

Date: Wed, 18 Nov 1998 11:17:11 +0000
From: "eva m. klopper" <eva_spiral@hotmail.com>
Subject: MacPerl + Resource Fork
Message-Id: <3652ACB7.3D17EBC1@hotmail.com>

Hello all,

I have a weird task to do here. A client has sent us a file that appears
to contain a Mac resource fork that has been transformed into a data
fork.

What I've been trying to do is use MacPerl to open the data fork, slurp
in the data (OK so far), then open the resource fork of a new file and
write it out as a single block of data.

Stuck here...

Does anyone know if this is even possible? Already tried ResEdit and
Resourcerer without much luck.

Thanks in advance.

Jason




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

Date: Wed, 18 Nov 1998 09:51:34 +0000
From: Matt Sergeant <matt@teamamiga.org_NOSPAM>
Subject: Re: NT4 - SP4 affects perl and desktop menu?
Message-Id: <365298A6.5148E88B@teamamiga.org_NOSPAM>

John Warner wrote:
> 
> Beware SP4.  At my previous job, my manager tried running some of our software
> on an SP4 box and wound up blowing away the NT install and trying again.  A
> friend (and former coworker) is a network administrator for company that has MS
> reps on-site on a near daily basis tells me that the MS reps do not recommend
> usage of SP4.  Apparently, it caused a great deal of trouble for MS SQL server
> (both 6.5 sp4 and 7).  Based on all the experiences that others I have known
> have had with SP4, I would recommend uninstalling it and going back to SP3.

My warning to all perl users out there would be to "AVOID SP4 AT ALL
COSTS". It completely hosed 2 systems here (Ericsson), both critical web
servers. It caused all sorts of bizarre things to happen to OLE, ODBC
and other low level services. Most perl scripts broke (they use ASP).

Also, uninstalling SP4 is no easy task - you may end up formatting your
disk and starting again.

The only good thing about this is I managed to persuade my boss to let
us use Linux ;-)

-- 
<Matt email="matt@teamamiga.org" />

| Fastnet Software Ltd              |   Perl in Active Server Pages   |
| Perl Consultancy, Web Development |   Database Design   |    XML    |
| http://come.to/fastnet            |    Information Consolidation    |


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

Date: Wed, 18 Nov 1998 09:40:50 +0000
From: Matt Sergeant <matt@teamamiga.org_NOSPAM>
Subject: Re: Perl Usage Survey - interpretations, anyone?
Message-Id: <36529622.BD3177B4@teamamiga.org_NOSPAM>

Rich Morin wrote:
> 
> We _know_ that Linux and Mac OS have lots of devoted users, so these
> numbers may be a bit distorted.  I don't really think there is much
> ballot-stuffing going on; why would anyone bother?

Err, sorry to dissapoint. The Linux numbers went up over 1000 in 1 day
due to being slashdotted. (announced on slashdot.org). I watched it
happen. Before the slashdot effect, the Linux and Win32 numbers were
equal (I think Win32 might have even had a slight lead).

-- 
<Matt email="matt@teamamiga.org" />

| Fastnet Software Ltd              |   Perl in Active Server Pages   |
| Perl Consultancy, Web Development |   Database Design   |    XML    |
| http://come.to/fastnet            |    Information Consolidation    |


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

Date: Wed, 18 Nov 1998 10:26:05 GMT
From: huntersean@hotmail.com
Subject: Possible bug in "sort"
Message-Id: <72u7bh$md6$1@nnrp1.dejanews.com>

I have recently discovered what I think may be a bug in the way perl parses
calls to "sort".  When using the form "sort SUBNAME LIST", I can happily use
a literal or a scalar for a subname, but I can't use a member of a hash to
specify the subname. perl -v gives me "This is perl, version 5.004_04 built
for i386-linux".

The following code will demonstrate:

#!/usr/bin/perl -w
use strict qw/subs vars/;

my @array = qw(foo
	       bar
	       cheese
	       sheep);

my %hash = (actually => "a lot more complicated than this",
	    order => "asc_byname");

sub asc_byname {$a cmp $b;}

$\ = "\n";

print join " ", sort asc_byname @array;
#print sort $hash{order} @array;
#...the above line doesn't work.  It gives
#Array found where operator expected at ./bugreport.pl line 17, near "} "
#        (Missing operator before  ?)
#syntax error at ./bugreport.pl line 17, near "} @array"
#Execution of ./bugreport.pl aborted due to compilation errors.

my $order = $hash{order};
print join " ", sort $order @array;
__END__
The code works until you uncomment the line:
"print sort $hash{order} @array;"

I can't see why the last sort (using an intermediate) works, and not the
previous one.

Basically, I think the perl parser things the braces of the hash are a code
block for the block form of "sort", and gets hopelessly confused.

Apologies if I'm just being dumb.

Sean Hunter

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 18 Nov 1998 11:32:27 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Possible bug in "sort"
Message-Id: <slrn755c2b.j32.sholden@pgrad.cs.usyd.edu.au>

On Wed, 18 Nov 1998 10:26:05 GMT, huntersean@hotmail.com
	<huntersean@hotmail.com> wrote:
<snip>
>The code works until you uncomment the line:
>"print sort $hash{order} @array;"
>
>I can't see why the last sort (using an intermediate) works, and not the
>previous one.
>
>Basically, I think the perl parser things the braces of the hash are a code
>block for the block form of "sort", and gets hopelessly confused.

>From perlfunc's documentation about sort :
=item sort SUBNAME LIST
<snip>
SUBNAME may be a scalar variable name (unsubscripted), in which case
the value provides the name of (or a reference to) the actual subroutine
to use.

I suspect {order} above is a subscript. Then again I'm making a guess as
to what subscripted means in this context. You the same error (modulo [ and ()
if you try it with an array so I doubt it is the brackets confusing the parser.


-- 
Sam

Another result of the tyranny of Pascal is that beginners don't use
function pointers.
	--Rob Pike


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

Date: Wed, 18 Nov 1998 07:59:50 +0200
From: Alexander Avtanski <sasho@staff.mgu.bg>
Subject: Re: Somthink don`t know~!PLS Help me
Message-Id: <36526256.B5A9B90B@staff.mgu.bg>


--------------CC1FB83D974DED549CE8434A
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

"+X%J(Tony)" wrote:

> In perl, Is
>  $numberfile = "/data1/hypermart.net/tonyt/$npo.txt";
> right????
> If no how to write it???
> pls help!
> (Sorry My English is not good!)

It seems right, supposing that $npo is a variable.

--
Alexander Avtanski
sasho@staff.mgu.bg



--------------CC1FB83D974DED549CE8434A
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
"&laquo;&Oslash;&yen;J(Tony)" wrote:
<blockquote TYPE=CITE>In perl, Is
<br>&nbsp;$numberfile = "/data1/hypermart.net/tonyt/$npo.txt";
<br>right????
<br>If no how to write it???
<br>pls help!
<br>(Sorry My English is not good!)</blockquote>
It seems right, supposing that $npo is a variable.
<pre>--
Alexander Avtanski
sasho@staff.mgu.bg</pre>
&nbsp;</html>

--------------CC1FB83D974DED549CE8434A--



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

Date: Wed, 18 Nov 1998 16:42:48 +0800
From: "=?utf-8?B?5bu65LuUKFRvbnkp?=" <tonyt@hknet.com>
Subject: Re: Somthink don`t know~!PLS Help me
Message-Id: <365287da.0@ruby.hknet.com>

This is a multi-part message in MIME format.

------=_NextPart_000_0020_01BE1312.7AB6EC20
Content-Type: text/plain;
	charset="utf-8"
Content-Transfer-Encoding: quoted-printable

It get from html
    Alexander Avtanski =E6=92=B0=E5=AF=AB=E6=96=BC=E6=96=87=E7=AB=A0 =
<36526256.B5A9B90B@staff.mgu.bg>...
    "=C2=AB=C3=98=C2=A5J(Tony)" wrote:=20
        In perl, Is=20
         $numberfile =3D "/data1/hypermart.net/tonyt/$npo.txt";=20
        right????=20
        If no how to write it???=20
        pls help!=20
        (Sorry My English is not good!)
    It seems right, supposing that $npo is a variable.=20
--
Alexander Avtanski
sasho@staff.mgu.bg
     =20

------=_NextPart_000_0020_01BE1312.7AB6EC20
Content-Type: text/html;
	charset="utf-8"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Dbig5 =
http-equiv=3DContent-Type><!doctype html public "-//w3c//dtd html 4.0 =
transitional//en">
<META content=3D'"MSHTML 4.72.3509.100"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 size=3D2>It get from html</FONT></DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: =
5px">
    <DIV>Alexander Avtanski<SASHO@STAFF.MGU.BG> =
=BC=B6=BCg=A9=F3=A4=E5=B3=B9 &lt;<A=20
    =
href=3D"mailto:36526256.B5A9B90B@staff.mgu.bg">36526256.B5A9B90B@staff.mg=
u.bg</A>&gt;...</DIV>&quot;&laquo;&Oslash;&yen;J(Tony)&quot;=20
    wrote:=20
    <BLOCKQUOTE TYPE =3D CITE>In perl, Is <BR>&nbsp;$numberfile =3D=20
        &quot;/data1/hypermart.net/tonyt/$npo.txt&quot;; <BR>right???? =
<BR>If no=20
        how to write it??? <BR>pls help! <BR>(Sorry My English is not=20
    good!)</BLOCKQUOTE>It seems right, supposing that $npo is a =
variable. <PRE>--
Alexander Avtanski
sasho@staff.mgu.bg</PRE>&nbsp; </BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0020_01BE1312.7AB6EC20--



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

Date: Wed, 18 Nov 1998 10:53:31 +0000
From: Balazs Rauznitz <prauz@sprynet.com>
To: jtjohnston@erase.courrier.usherb.ca
Subject: Re: Substitution Grief
Message-Id: <3652A72B.1E012A6@sprynet.com>

JTJ wrote:
> 
> I am playing with a Web-Based E-mailer. How do I extract a web address
> in a block of text and replace it with a link:
> 
> -------- Sample message ---------
> here is the link:
> http://somewhere.com
> ---------------------------------
> 
> ---------- What I want ----------
> here is the link:
> <A HREF="http://somewhere.com">http://somewhere.com</A>
> ---------------------------------
> 
> I would use a substitution string:
> 
> $message =~ s/???/???/g;
> 
> Something like??
> 
>         $message =~ s/http:\/\/\s*(\w+|$)/????/go;
> 
> Thanks in advance.
> 
> JTJ

I'd use something like this:
$message  =~ s{(http://[\w.\/]+)}{<a href="$1">$1</a>}g;

Hope that's what you wanted:

Balazs


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

Date: 18 Nov 1998 11:36:16 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Trouble creating a new file
Message-Id: <83k90t9tjz.fsf@vcpc.univie.ac.at>

Re: Trouble creating a new file, Paul <pauljr@nt.com> said:

Paul> if you look at the end of the message you can see that
Paul> the error is giving me my "could not open file"
Paul> message. This would tell me that my file was created
Paul> no problem right? Wrong! It's not there. What made me
Paul> write this message in the hope I would get a reply is
Paul> that my script works fine directly in
Paul> UNIX.

See the don't-be-offended-by-the-name

    http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html

and questions 4 and 5 in particular.

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien,  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: 17 Nov 1998 23:04:59 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Two-Part RE question
Message-Id: <m3pvalleno.fsf@moiraine.dimensional.com>

Uri Guttman <uri@sysarch.com> writes:

> >>>>> "ss" == sara starre <gear4u@hotmail.com> writes:

>   ss>                   interpret this special RE I designed expecially for
>   ss> you: $x =~ [4q];
> 
> this matches '4' or 'q'. any more interpretation needed?

Nope, it matches `4' followed by `q'. :-)

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
Supporter of grumpiness where grumpiness is due on clpm.
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: 18 Nov 1998 06:36:21 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Two-Part RE question
Message-Id: <72tpt5$hj4$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Daniel Grisinger 
<dgris@moiraine.dimensional.com>],
who wrote in article <m3pvalleno.fsf@moiraine.dimensional.com>:
> Uri Guttman <uri@sysarch.com> writes:
> 
> > >>>>> "ss" == sara starre <gear4u@hotmail.com> writes:
> 
> >   ss>                   interpret this special RE I designed expecially for
> >   ss> you: $x =~ [4q];
> > 
> > this matches '4' or 'q'. any more interpretation needed?
> 
> Nope, it matches `4' followed by `q'. :-)

I did not check (with -Mre=debugcolor), but my guess would be
"unfinished q]] quoting" or some such. If it were [q4], it would match
`A' followed by `R' followed by `R' followed by `A' followed by `Y'
etc, you got the picture.

Of course, I may be completely wrong...

Ilya


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

Date: 18 Nov 1998 01:55:05 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Two-Part RE question
Message-Id: <x767cd4hiu.fsf@sysarch.com>

>>>>> "IZ" == Ilya Zakharevich <ilya@math.ohio-state.edu> writes:

  IZ> [A complimentary Cc of this posting was sent to Daniel Grisinger 
  IZ> <dgris@moiraine.dimensional.com>],
  IZ> who wrote in article <m3pvalleno.fsf@moiraine.dimensional.com>:
  >> Uri Guttman <uri@sysarch.com> writes:
  >> 
  >> > >>>>> "ss" == sara starre <gear4u@hotmail.com> writes:
  >> 
  >> >   ss>     interpret this special RE I designed expecially for
  >> >   ss> you: $x =~ [4q];
  >> > 
  >> > this matches '4' or 'q'. any more interpretation needed?
  >> 
  >> Nope, it matches `4' followed by `q'. :-)

  IZ> I did not check (with -Mre=debugcolor), but my guess would be
  IZ> "unfinished q]] quoting" or some such. If it were [q4], it would match
  IZ> `A' followed by `R' followed by `R' followed by `A' followed by `Y'
  IZ> etc, you got the picture.

my bad. i was reading it as a true regex, not perl syntax. i didn't see
the lack of // or m[].

perl -e '$x =~ [4q]'
Can't find string terminator "]" anywhere before EOF at -e line 1.

so dan is wrong and ilya is right!

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 18 Nov 1998 00:03:37 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Two-Part RE question
Message-Id: <m3hfvxlbxy.fsf@moiraine.dimensional.com>

ilya@math.ohio-state.edu (Ilya Zakharevich) writes:

> [A complimentary Cc of this posting was sent to Daniel Grisinger 
> <dgris@moiraine.dimensional.com>],
> who wrote in article <m3pvalleno.fsf@moiraine.dimensional.com>:

> > Nope, it matches `4' followed by `q'. :-)
> 
> I did not check (with -Mre=debugcolor), but my guess would be
> "unfinished q]] quoting" or some such.

Nope, it's `Can't find string terminator "]"'.  I can't believe
the things some people will post around here, especially with
no testing whatsoever.  :-)

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
Supporter of grumpiness where grumpiness is due on clpm.
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 4245
**************************************

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