[9813] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3406 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 10 13:07:12 1998

Date: Mon, 10 Aug 98 10:00:18 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 10 Aug 1998     Volume: 8 Number: 3406

Today's topics:
    Re: Access, ODBC and Linux <thaynes@openlinksw.co.uk>
    Re: Can't make flock work as described... <merlyn@stonehenge.com>
    Re: Can't make flock work as described... <sneaker@sneex.fccj.org>
        Changing ownership with win32 perl?? <phenning@phoenix-int.com>
    Re: chown -h (Mark-Jason Dominus)
    Re: hiding user input birgitt@my-dejanews.com
    Re: HTTP_Proxy enviroment variable also doesn't work chuckk@monmouth.com
    Re: Newbie Question About 'for' <grant.griffin@nospam.com>
    Re: Newbie Question About 'for' (Mike Stok)
    Re: Newbie Question About 'for' (Larry Rosler)
    Re: Perl Docs.. forget the original post (Chip Salzenberg)
    Re: perlfaq - frequently asked questions about Perl (pa <murrayb@vansel.alcatel.com>
    Re: Regex problem (Larry Rosler)
    Re: Regex problem <l.e.kolden@hfstud.uio.no>
    Re: sorting hash by values <jdporter@min.net>
    Re: Status of MailTools-1.11 <Robert.Lopez@abq.sc.philips.com>
    Re: String comparison problem aircond@my-dejanews.com
    Re: strings (Mark-Jason Dominus)
        variable interpolation (Brian Day)
    Re: Where can I find the binary for perl at least 5.002 dave@mag-sol.com
    Re: Where can I find the binary for perl at least 5.002 <aqumsieh@matrox.com>
    Re: Windows 95 perl and long-directory names. (Brian Day)
    Re: X-file (?=...), case postponed. (Patrick Timmins)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Mon, 10 Aug 1998 16:30:48 GMT
From: Tim Haynes <thaynes@openlinksw.co.uk>
Subject: Re: Access, ODBC and Linux
Message-Id: <6qn77o$hhb$1@nnrp1.dejanews.com>

Hi, You need the OpenLink ODCBSDK for Linux, the client-part of the
multi-tier database access driver suite. (You'll also need a server component
to go on the Access server machine.)

If you define a system DSN over the Access driver on the Access server
machine, then configure an OpenLink DSN on the Linux machine to point to a
database of type "ODBC" using the access DSN as a database name, it will
connect happily from Linux with Perl.

OpenLink is available from http://www.openlinksw.co.uk/ .

Regards,

~Tim

In article <m3zpdhxf8u.fsf@gromit.adrenaline.fr>,
  sdupille@yahoo.com (Stiphane Dupille) wrote:
>
> 	Hi there !
>
> 	I try to access Access database on WinNT from a linux
> workstation.
>
> 	I get DBI 0.93 and DBD-ODBD 0.17. DBI was installed
> succesfully, but I get an error when I compile DBD-ODBC :
> In file included from ODBC.h:9,
>                  from ODBC.xs:1:
> mysql.h:9: isql.h: No such file or directory
> mysql.h:10: isqlext.h: No such file or directory
> make: *** [ODBC.o] Error 1
>
> 	So, where can I find these two files : isql.h and isqlext.h ?
>
> 	Does anyone succeded in acceding ODBC database via Perl ?
>
> 	Please send a copy of the response via email too, because it's
> very urgent !!
>
> --
>   ___
> {~._.~}                    Stephane - DUST - Dupille
>  ( Y )            You were dust and you shall turn into dust
> ()~*~()                    email : sdupille@yahoo.com
> (_)-(_)
>

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Mon, 10 Aug 1998 15:50:41 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Can't make flock work as described...
Message-Id: <8c4svkvnsq.fsf@gadget.cscaper.com>

>>>>> "Todd" == Todd B <tbeaulieu@mediaone.net> writes:

Todd> i have noticed that several of the "high profile" users in this
Todd> group appear to be very short on patience and long on rudeness.

I have noticed that several of the "new" users in this group appear to
be very short on their awareness of Usenet conventions and the
existing documentation, and long on expecting us to write their code
for them.

Todd> i keep reading very curt, offensive replies, which appear to be
Todd> building up the egos of the senders, and making the rest of us
Todd> feel stupid.

I keep reading very rambling, unclear posts, which appear to be
shifting the burden of the work from the poster to the respondant,
making the rest of us feel weary.

Todd> this is why i HATE newgroups, and love compuserve.  there is
Todd> such an enormous lack of professionalism on the net.

This is why I hate the fact that "Netscape" and "MSIE" have a "post"
button.  There is such an enormous lack of maturity on the net.

(Note: all strictly tongue-in-cheek... if you're offended, you
must be easily offended. :-)

-- 
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: Mon, 10 Aug 1998 12:21:57 -0400
From: Bill 'Sneex' Jones <sneaker@sneex.fccj.org>
Subject: Re: Can't make flock work as described...
Message-Id: <35CF1E25.92595805@sneex.fccj.org>

Randal Schwartz wrote:
> 
><snip> 
> ... if you're offended, you
> must be easily offended. :-)
> 

:]
-Sneex- 
__________________________________________________________________
Bill Jones | FCCJ Webmaster | Life is a 'Do it yourself' thing...
             http://webmaster.fccj.org/cgi/mail?webmaster


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

Date: Mon, 10 Aug 1998 12:52:00 -0400
From: "P.J. Henningson" <phenning@phoenix-int.com>
Subject: Changing ownership with win32 perl??
Message-Id: <35CF2530.CDBB7032@phoenix-int.com>

With Win32 Perl,
is it possible to change file ownership from
one user to another (not "taking ownership" but
giving it to someone else, similiar to chown in UNIX)

Thanks,
P.J. Henningson


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

Date: 10 Aug 1998 12:19:29 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: chown -h
Message-Id: <6qn6ih$naf$1@monet.op.net>

In article <sweth-usenet-0908981637470001@alex-va-n013c081.moon.jic.com>,
Sweth Chandramouli <sweth-usenet@astaroth.nit.gwu.edu> wrote:
>   is there some way to have the chown function in perl work like the
>chown program itself does when invoked with the -h flag (i.e. affect a
>symlink if that is its target, rather than the file to which that symlink
>points)?  

Use syscall(&SYS_lchown, ...).  See the `perlfunc' man page for more details.

>alternately, can chown be given device and inode info (as obtained
>from lstat) to define its target, to get around the problem entirely?

Of course not.  If the operating system let you do that, it would
render  the filesystem's permissions void.


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

Date: Mon, 10 Aug 1998 15:58:44 GMT
From: birgitt@my-dejanews.com
Subject: Re: hiding user input
Message-Id: <6qn5bk$1q7$1@nnrp1.dejanews.com>

In article <pudge-1008980901000001@192.168.0.3>,
  pudge@pobox.com (Chris Nandor) wrote:

> # Chris Nandor <pudge@pobox.com> writes:

> # > Not a chance.  RFCs do not laws make.  I would contend that it is not
> # > possible to make a constitutional law that would disallow me from
> # > keeping a public archive of everything ever posted to any or all
> # > newsgroups.  The post is by definition public once it is posted.

hm, I just thought I had learned from the FAQ "What is usenet" (a second
opinion) that usenet is not a public utility. (some quotes: Usenet is
carried over circuits provided by public utilities, public switch phone
networks and lines leased from public carries. ...Most usenet sites were
operated by organizations which were not public. ....Most usenet sites
are not publicly funded or subsidized. Usenet sites are commercial
entities....Freedom of Press belongss to those who own one).

So, if the server and the circuits are not public ones, I would
have thought that the posts too are not public posts.

> What if I had an NNTP server, public, that "archived" everything
> "forever"?

When does a news server becomes a public one ? What is the
definition of public in this context ? Paid for through taxes by the
whole population and owned by the government ?

Sorry, another off-topic question. Just would like to
understand it  - where should this be followed up ?

Birgitt Funk

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Mon, 10 Aug 1998 16:09:05 GMT
From: chuckk@monmouth.com
Subject: Re: HTTP_Proxy enviroment variable also doesn't work
Message-Id: <6qn5uv$68n$1@nnrp1.dejanews.com>

In article <35CEFD66.A260DE52@hp.com>,
  Pep Mico <pep_mico@hp.com> wrote:
> Hi Chuck
> Thanks for your suggestion,  I will try it.
>
> I've been investigating how PPM.PL works and I've seen that it is able to use
an
> environment varialbe named HTTP_proxy.
>
> I've tried to work with it assigning my Web-Proxy server, but it does't work.
Have
> you seen it?
>
> Regards
> pep_mico@hp.com
>

Nope. I don't think the HTTP_proxy works.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Mon, 10 Aug 1998 10:46:12 -0500
From: Grant Griffin <grant.griffin@nospam.com>
Subject: Re: Newbie Question About 'for'
Message-Id: <35CF15C4.380A202D@nospam.com>



Mike Stok wrote:

> Perl's for is a synonym for foreach, and the type of loop depends on the
> contents of the parens.

I am a journeyman-level Perl'er, but the fact that "for" is synonomous with
"foreach" was new to me.  Why are they synonyms?  Isn't that just another pothole
to step in (as shown by the original question)?

strictly yours,

=g2




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

Date: 10 Aug 1998 16:08:58 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Newbie Question About 'for'
Message-Id: <6qn5uq$q58@news-central.tiac.net>

In article <35CF15C4.380A202D@nospam.com>,
Grant Griffin  <grant.griffin@nospam.com> wrote:

>Mike Stok wrote:
>
>> Perl's for is a synonym for foreach, and the type of loop depends on the
>> contents of the parens.
>
>I am a journeyman-level Perl'er, but the fact that "for" is synonomous with
>"foreach" was new to me.  Why are they synonyms?  Isn't that just
>another pothole
>to step in (as shown by the original question)?

Perl's history has a lot to do with borrowing useful bits from other
languages, and unix shells and utilities are the roots of many of perl's
features.  In the C shell

  foreach x (1 2 3)
    echo $x
  end

does much the same as the bourne shell

  for x in 1 2 3
  do
    echo $x
  done

both of these iterate through an arbitrary list but one uses the keyword
for and the other foreach, so depending on which shell you were used to
you might say

  foreach $x (1, 2, 3) { ... }

or

  for $x (1, 2, 3) { ... }

Then there's the C for statement which synthesises a sequence as it goes

  for (x = 1; x < 4; x++) {
    ...
  }

So there are historical reasons for the design decision, and we've ended
up where we are.

Pretty much any useful tool has potholes you have to navigate while
learning it, and I am grateful that perl hasn't been slaughtered on the
altar of regularisation (yet)  Perl gives you many ways to express things,
and this is one of them.

Mike


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


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

Date: Mon, 10 Aug 1998 09:30:17 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Newbie Question About 'for'
Message-Id: <MPG.1038bff6c0e2d7f39897c2@nntp.hpl.hp.com>

In article <35CF15C4.380A202D@nospam.com> on Mon, 10 Aug 1998 10:46:12 -
0500, Grant Griffin <grant.griffin@nospam.com> says...
> Mike Stok wrote:
> 
> > Perl's for is a synonym for foreach, and the type of loop depends on the
> > contents of the parens.
> 
> I am a journeyman-level Perl'er, but the fact that "for" is synonomous with
> "foreach" was new to me.  Why are they synonyms?  Isn't that just another pothole
> to step in (as shown by the original question)?

Mike Stok has answered historically.  Stylistically, it is probably wise 
to use 'foreach' to introduce iteration over a list, and 'for' to 
introduce a C-style 'for' loop.  That way, your eye (and those of other 
readers, for this is the way it's typically documented and taught) will 
expect the two semicolons for 'for' but not for 'foreach'.

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


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

Date: Mon, 10 Aug 1998 16:29:48 GMT
From: chip@pobox.com (Chip Salzenberg)
Subject: Re: Perl Docs.. forget the original post
Message-Id: <6qn78c$ifj$1@cyprus.atlantic.net>

According to pudge@pobox.com (Chris Nandor):
> The Perl community is a meritocracy.

It's more of a gift culture, I think.  You could call it a meritocracy,
though, if you define "meritous" as "helpful".

> The more you do for the community, the more you are valued in
> the community.

Yes ... but it should be noted that (1) what's given is appreciated
for its helpfulness to the receiver, not its expense to the giver; and
(2) it's possible to throw away good will through the time-honored
means of acting like a butthead.
-- 
Chip Salzenberg                - a.k.a. -               <chip@pobox.com>
"I brought the atom bomb.  I think it's a good time to use it."  //MST3K
           ->  Ask me about Perl training and consulting  <-
     Like Perl?  Want to help out?  The Perl Institute: www.perl.org


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

Date: 10 Aug 1998 08:37:56 -0700
From: Brad Murray <murrayb@vansel.alcatel.com>
Subject: Re: perlfaq - frequently asked questions about Perl (part 0 of 9)
Message-Id: <u4svk6e5n.fsf@vansel.alcatel.com>

"Curtis Jewell / Dennis Whalen" <cjdpcssd@ims-1.com> writes:

> Yes, I found THAT out. Now, does anybody know of a Win95 port of either one
> (or of man), or instructions on the format (and no, man nroff/troff/man on
> my nearest Unixen don't tell me much about *roff markup - what would?)

If your nearest Unix box is near enough, you can do what I do:

  rsh hostname groff -man < file.pod > file.ps

 ...and bingo, postscript for printing.  Good man pages can be had this way
for viewing under less (ports available for all systems I expect):

  rsh hostname groff -Tascii -man < file.pod > file.text

Sometimes the solution can be to use Unix even if it's not on your machine---
hence the joy of informally distributed processing.

-- 
Brad Murray              "The large print giveth 
Software Analyst          and the small print taketh away."
Alcatel Canada            --Tom Waits, Step Right Up


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

Date: Mon, 10 Aug 1998 09:04:03 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Regex problem
Message-Id: <MPG.1038b9ca248c47ee9897c1@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <35CF11BF.49C0D89F@hfstud.uio.no> on Mon, 10 Aug 1998 17:29:04 
+0200, Lars Erik Kolden <l.e.kolden@hfstud.uio.no> says...
 ... 
> open(BODY, ">>$body_file") || &error(bad_open);      # I'm a bit unsure
> about how to open a file for substitution.
> while (<BODY>) {
> s!                # here comes the regex, which doesn't match. Even not
> if I only open the file for input and uses the
>                # m operator.

You are trying to read input from a file that is opened only for writing, 
so this surely will not work.  However, let's proceed on the assumption 
that you have indeed opened the file for reading and are trying to match.

As your matches span multiple lines, you do not want to read one line at 
a time.  Use this to get all the input into one string:

{ local $/; $file = <BODY> }

>    # Line 1
>    ^

Take out this anchor, unless the very beginning of the file has special 
significance.

>    \s*
>    <tr>
>    \n
> 
>    # Line 2
>    .*
>    $linktext
>    .*
>    \n

 .*\n.* is synonymous with .* when you use the /s modifier on the regex, 
as you should since new-lines really are not significant here.

 ...

All those greedy matches (.*) mean that you will match from the first 
<tr> through the last </tr> which is probably not what you want.  Try 
replacing them with .*? (non-greedy) matches.
 
>    # Line 5
>    \s*
>    </tr>
>    .*
>    \n
> 
> !!mgx;
> }

'm' is not desired, because you don't want special treatment for the ^ or 
$ anchors.   'g' is not desired, because you want to match once only.  On 
the other hand, 's' is required to let '.' include new-lines, and 'i' is 
desired because HTML matches should be case-insensitive.

That's a lot to think about.  Good luck!

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


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

Date: Mon, 10 Aug 1998 18:48:56 +0200
From: Lars Erik Kolden <l.e.kolden@hfstud.uio.no>
Subject: Re: Regex problem
Message-Id: <35CF2478.740F613B@hfstud.uio.no>

Larry Rosler wrote:

> [Posted to comp.lang.perl.misc and copy mailed.]
>
> In article <35CF11BF.49C0D89F@hfstud.uio.no> on Mon, 10 Aug 1998 17:29:04
> +0200, Lars Erik Kolden <l.e.kolden@hfstud.uio.no> says...
> ...
> > open(BODY, ">>$body_file") || &error(bad_open);      # I'm a bit unsure
> > about how to open a file for substitution.
> > while (<BODY>) {
> > s!                # here comes the regex, which doesn't match. Even not
> > if I only open the file for input and uses the
> >                # m operator.
>
> You are trying to read input from a file that is opened only for writing,
> so this surely will not work.  However, let's proceed on the assumption
> that you have indeed opened the file for reading and are trying to match.
>
> As your matches span multiple lines, you do not want to read one line at
> a time.  Use this to get all the input into one string:
>
> { local $/; $file = <BODY> }

I guess these are only ordinary statements, and that this is done in the
while block of the script? (That it is right to match the regex in a while
loop as I've done).


>
>
>
> That's a lot to think about.  Good luck!

Yes, indeed. Thank you very much. I know, >> is wrong for substitution, but
should I use +>? I've seen +>> aswell, but with the same explanation of what
it does.

Lars Erik Kolden
l.e.kolden@hfstud.uio.no



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

Date: Mon, 10 Aug 1998 12:33:25 -0400
From: John Porter <jdporter@min.net>
Subject: Re: sorting hash by values
Message-Id: <35CF20D5.784A@min.net>

Tony Labbiento wrote:
> 
> sub mysort {
>     my ($gtl);
>     if ( $hash{$a} == $hash{b})
>         $gtl = $a cmp $b;
>     } else {
>         $gtl = $hash{$a} <=> $hash{$b};
>     }
>     return $gtl;
> }

There's a big efficiency problem in that code: 
you compare $hash{$a} to $hash{$b} twice 
(except in cases where they happen to be equal).  
If you compare them using <=> first, then you don't
have to compare them again.

First, rewrite so that the branches are swapped:

    if ( $hash{$a} != $hash{b} ) {
        $gtl = $hash{$a} <=> $hash{$b};
    } else {
        $gtl = $a cmp $b;
    }

Note that != and <=> evaluate identically in a boolean
context.  So use <=> for the boolean test:

    if ( $hash{$a} <=> $hash{b} ) {
        $gtl = $hash{$a} <=> $hash{$b};
    } else {
        $gtl = $a cmp $b;
    }

Now cache the value of that comparison:

    $gtl = $hash{$a} <=> $hash{$b};
    if ( $gtl ) {
    } else {
        $gtl = $a cmp $b;
    }

Which of course is the same as:

    $gtl = $hash{$a} <=> $hash{$b};
    if ( ! $gtl ) {
        $gtl = $a cmp $b;
    }

A nice shorthand for this situation, which happens
to crop up a lot, is:

    $gtl = $hash{$a} <=> $hash{$b};
    $gtl ||= $a cmp $b;

Of course, if that's all you're doing, you may as well say:

    $gtl = $hash{$a} <=> $hash{$b}
        || $a cmp $b;

So mysort actually looks like this:

    sub mysort {
        my $gtl;
        $gtl = $hash{$a} <=> $hash{$b} || $a cmp $b;
        return $gtl;
    }

Which is obviously nothing more than

    sub mysort {
        $hash{$a} <=> $hash{$b} || $a cmp $b;
    }

Which means you can skip the subroutine altogether:

  for ( 
    sort { $hash{$a} <=> $hash{$b} || $a cmp $b } keys %hash
  ) {
    ....
  }

I'd like to commend Tony for bringing up the good point
that the hash can be sorted by keys when the values are
equal.

-- 
John Porter


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

Date: 10 Aug 1998 10:08:39 -0600
From: Robert Lopez <Robert.Lopez@abq.sc.philips.com>
Subject: Re: Status of MailTools-1.11
Message-Id: <jc690kwes54.fsf@abqn07.ato.sca.philips.com>



Tom Phoenix <rootbeer@teleport.com> writes:

> On 7 Aug 1998, Robert Lopez wrote:
> 
> > I have been trying to download MailTools-1.11.tar.gz from
> > cpan and regardless of the site I can read the MailTools-1.11.readme
> > file but can not successfully down load any version of MailTools gz
> > file. I get "Unknown status reply from server: 1!"
> > What am I doing wrong?
>
> Your client for downloading is probably misconfigured, and doesn't know
> how to handle .gz files. (Or, the servers are trying to give you the wrong
> Mime type.) Try getting it by FTP instead, if nothing else works. Good
> luck!
> 
> -- 
> Tom Phoenix       Perl Training and Hacking       Esperanto
> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
> 

Thanks Tom. I am using Netscape 4.05/Export, 26-Mar-98, and it has no
problem with any .gz file from any of dozens of other sites. I just
tried to ftp it from ftp.cs.colorado.edu and when I had migrated my
way down into it I got "FTP Error-501 Unknown ftp problem".
-- 




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

Date: Mon, 10 Aug 1998 16:16:05 GMT
From: aircond@my-dejanews.com
Subject: Re: String comparison problem
Message-Id: <6qn6c4$a22$1@nnrp1.dejanews.com>

I'd try wrapping the strings in quotes, also a good debugging tip to determine
if there's crap after your string is to print something after the string, like
print "${somestring}!!\n";

to see if the bangs comne out where you'd want them to.

Hope this helps -

BTW - go jackets :)


In article <6qmrep$348@catapult.gatech.edu>,
  gt2863a@acmey.gatech.edu (Mark Conlin) wrote:
>
> Okay, I am trying to see if two strings are equal
>
> so my code says
>
> if ($submit{'orginal'} eq $name){
>
> this was not working so I decided to print the two strings to see
> what was going  on so
>
> print OUTFILE "org     = $submit{'original'}\n";
> print OUTFILE "current = $name \n";
> if ($submit{'orginal'} eq $name){
>
> now they appear to be the same, here is an exact cut from the output
>
> org     = Phyllis Kingston
> current = Phyllis Kingston
>
> Okay I know what you thinking, some kind of special character at the end?
> so I chop them and get this
>
> org     = Phyllis Kingsto
> current = Phyllis Kingsto
>
> What else could be going on here ?
>
> thanks
> Mark Conlin
>
> --
> mec --gt2863a
>
>

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 10 Aug 1998 12:29:53 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: strings
Message-Id: <6qn761$ndu$1@monet.op.net>


In article <6qkuer$q49$2@marina.cinenet.net>,
Craig Berry <cberry@cinenet.net> wrote:
> Seems a silly way to have implemented things,

It seems to me that it's exactly the same as this:

	while (<DATA>) {
	  print $_+1, "\n";
	}

	__DATA__
	077

 ... which prints `78', and not `0100'.

Code and data aren't the same thing.

Anyway, the underscores weren't allowed in literal constants until
recently, but changing the way string-to-number conversions are
performed in data would have broken many programs.


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

Date: 10 Aug 1998 16:22:37 GMT
From: bday@cbr.eng.sun.com (Brian Day)
Subject: variable interpolation
Message-Id: <6qn6od$83e$2@engnews2.Eng.Sun.COM>
Keywords: perl cgi variable

Does anyone know if there is a way to have a variable name interpolated inside 
another variable name ? i.e.:
 
tally(sandwich);
tally(drink);

print "$sandwich_count";
print "$drink_count";


sub tally
{"$$_[0]_count";
} 

Any info would be greatly appreciated.

Thank You,
Brian

passme
 



---
Brian T. Day
email: bday@Eng.sun.COM
voice: (650) 336-1331

Sun Microsystems, Inc.	   
mailstop: UMTV03-02
901 San Antonio Rd
Palo Alto, CA 94303-4900
			




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

Date: Mon, 10 Aug 1998 15:53:29 GMT
From: dave@mag-sol.com
Subject: Re: Where can I find the binary for perl at least 5.002 (better 5.005) for Windows NT4.0 ?
Message-Id: <6qn51o$tbi$1@nnrp1.dejanews.com>

In article <35CEF369.6E42802B@Tuerner.de>,
  "Marcus T|rner" <Marcus@Tuerner.de> wrote:
> The page of www.perl.com directs me to a site whisch promise 5.003 and
> if I download it it's only 5.001.
> I searched about an hour and found only sources, but I need the ready
> made Software because I'm not a Softwaredeveloper and have no
> opportunity to compile anything.

Marcus,

The latest version of Perl for Win32 (now called ActivePerl) is based on the
Perl 5.005 source code and is available for downlaod at
<http://www.activestate.com>.

hth,

Dave...

--
dave@mag-sol.com
London Perl M[ou]ngers: <http://www.mag-sol.com/London.pm/>

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Mon, 10 Aug 1998 11:37:12 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Where can I find the binary for perl at least 5.002 (better 5.005) for Windows NT4.0 ?
Message-Id: <35CF13A8.69EF49DB@matrox.com>

Marcus T|rner wrote:
> 
> The page of www.perl.com directs me to a site whisch promise 5.003 and
> if I download it it's only 5.001.

try www.activestate.com

-- 
Ala Qumsieh             |  No .. not Just Another
ASIC Design Engineer    |  Perl Hacker!!!!!
Matrox Graphics Inc.    |
Montreal, Quebec        |  (Not yet!)


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

Date: 10 Aug 1998 16:41:32 GMT
From: bday@cbr.eng.sun.com (Brian Day)
Subject: Re: Windows 95 perl and long-directory names.
Message-Id: <6qn7rs$83e$4@engnews2.Eng.Sun.COM>

In using DOS batch files, I know that DOS shortens your long file names to eight characters by doing something like:

 Program Files = Progra~1

Therefore whenever you refer to a long file name in your program use Progra~1.

Do a dir in DOS and see what DOS is calling your long file name.

Brian


---
Brian T. Day
email: bday@Eng.sun.COM
voice: (650) 336-1331

Sun Microsystems, Inc.	   
mailstop: UMTV03-02
901 San Antonio Rd
Palo Alto, CA 94303-4900
			




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

Date: Mon, 10 Aug 1998 15:42:13 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: X-file (?=...), case postponed.
Message-Id: <6qn4cl$okr$1@nnrp1.dejanews.com>

In article <6qlk97$6o4$1@mathserv.mps.ohio-state.edu>,
  ilya@math.ohio-state.edu (Ilya Zakharevich) wrote:
> [A complimentary Cc of this posting was sent to Patrick Timmins
> <ptimmins@netserv.unmc.edu>],
> who wrote in article <6qf8qv$64c$1@nnrp1.dejanews.com>:
> > I'm still not getting this.
>
> I have no idea why.
>
>   a) Do you understand that /(?=.*)/ will do the same as // ?
>   b) Do you understand that extra () creates extra elements?
>
> Ilya
>

Regarding /(?=.*)/ :
I get it now (thanks to Daniel Grisinger via e-mail). the (?=.*) will
return nothing to split, by definition. Zero or more of any character
must be present for split's /../ to match, but whatever is in (?=.*)
won't be returned to split for it to operate on, it just has to be there.
Since there is nothing else between the /../, then split /(?=.*)/ causes
split to split on the null character, just as split // does. I now
understand this.

regarding () creating extra elements in a split context :
I thought I already understood this, but apparently I still don't:

@arr =  split /(.*)/s , "Just another Perl Hacker\n";
This splits on the entire JAPH line, including the \n (thanks to the
's' modifier on split). This initially returns a 3 element array:
('', 'Just another Perl Hacker\n', ''). The trailing null is removed,
as described in perldoc -f split, leaving a two element array of
the first two elements shown. I understand this.

I still don't get why the second element in
@arr =  split /(?=(.*))/s , "Just another Perl Hacker\n" is
'ust another Perl Hacker\n' instead of 'Just another Perl Hacker\n' .
Where is this documented? Don't the "inner parentheses" have priority
over the outer? To me, it seems more logical if @arr were to equal:
('J', 'Just another Perl Hacker\n', 'u', 'ust another Perl Hacker\n', etc).

So is this just a phenomenon of the regex engine / split interaction, or
is it actually designed to work this way?

Patrick Timmins
U. Nebraska Medical Center

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

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

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