[8349] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1966 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 24 18:13:28 1998

Date: Tue, 24 Feb 98 15:00:27 -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           Tue, 24 Feb 1998     Volume: 8 Number: 1966

Today's topics:
        AIX 4.3 vs. perl5.004_04: won't build <morrow@spots.ab.ca>
    Re: Avoiding $` (Earl Hood)
    Re: better way to do this? (blacktape)
    Re: CGI.pm a part of Perl (was Re: Cookies) (Bart Lateur)
    Re: Cookies <dannyman@arh0300.urh.uiuc.edu>
    Re: Detecting Video Settings (Martien Verbruggen)
    Re: factorial function? (Ilya Zakharevich)
        HELP array stuff <dcordero@giss.nasa.gov>
    Re: HELP: Modules load as root, not user. <asulai@ctp.com>
    Re: How to get the encrypted password string ? chris+usenet@netmonger.net
    Re: Internationalization schwern@starmedia.net
    Re: Java's hidden flaw <larryr@ucsd.edu>
        max limit on dbms open? <sen@ftd.com>
        Memory allocation and garbage collection geobo@els.liu.se
        Pattern Match <bp@bp.com>
        Pattern Matching for parsing tags  (Manhattan5)
    Re: Perl training UK (Chris Benson)
        problem with attrs locked method <ctc@cisco.com>
        PWS , WINDOWS95 and PERL <j.rasmussen@netjob.dk>
        reg expression help.. (Alex Krohn)
    Re: The Ineffable Tom C. (Sean Ahern)
    Re: The Ineffable Tom C. <tchrist@mox.perl.com>
    Re: ts: double vs single quotes (Andrew M. Langmead)
    Re: ts: double vs single quotes <dboorstein@shopcfn.com>
        Win95 - Running scripts from browser? (Burt Lewis)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 24 Feb 1998 21:33:04 GMT
From: Bill Morrow <morrow@spots.ab.ca>
Subject: AIX 4.3 vs. perl5.004_04: won't build
Message-Id: <6cveag$gjt$1@f02s02.tac.net>

perl5.004_o4 won't build on this AIX 4.3 box:

        AutoSplitting perl library

        Making DynaLoader (static)
gmake[1]: Entering directory `/usr/local/wfs/source/tools/perl5.004_04/ext/DynaLoader'
gmake[1]: Leaving directory `/usr/local/wfs/source/tools/perl5.004_04/ext/DynaLoader'
gmake[1]: Entering directory `/usr/local/wfs/source/tools/perl5.004_04/ext/DynaLoader'
cc -c  -qmaxmem=8192 -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -O    -DVERSION=\"1.03\" -DXS_VERSION=\"1.03\"  -I../.. -DPERL_CORE -DLIBC="/lib/libc.a" DynaLoader.c
"DynaLoader.xs", line 390.37: 1506-045 (S) Undeclared identifier BEGINNING.
gmake[1]: *** [DynaLoader.o] Error 1
gmake[1]: Leaving directory `/usr/local/wfs/source/tools/perl5.004_04/ext/DynaLoader'
gmake: *** [lib/auto/DynaLoader/DynaLoader.a] Error 1

So I insert
#define BEGINNING 0
(as defined on other architectures) in config.h, then:

cc   -bE:perl.exp -o perl perlmain.o lib/auto/DynaLoader/DynaLoader.a  libperl.a `cat ext.libs` -lnsl -ldbm -ldl -lld -lm -lc -lcrypt -lbsd -lPW -bnoquiet
 ...
[ a ton of warnings ]
ld: 0711-319 WARNING: Exported symbol not defined: Perl_free
ld: 0711-319 WARNING: Exported symbol not defined: allgvs
ld: 0711-317 ERROR: Undefined symbol: .FSEEK
ld: 0711-317 ERROR: Undefined symbol: .FREAD
ld: 0711-319 WARNING: Exported symbol not defined: curblock
ld: 0711-319 WARNING: Exported symbol not defined: curcsv
 ...
ld: 0711-319 WARNING: Exported symbol not defined: Perl_free
ld: 0711-318 ERROR: Undefined symbols were found.
        The following symbols are in error:
 Symbol                    Inpndx  TY CL Source-File(Object-File) OR Import-File{Shared-object}
                              RLD: Address  Section  Rld-type Referencing Symbol
 ----------------------------------------------------------------------------------------------
 .FSEEK                    [214]   ER PR DynaLoader.c(lib/auto/DynaLoader/DynaLoader.a[DynaLoader.o])
                                   000018a4 .text    R_RBR    [42]    <.readExports>
 .FREAD                    [216]   ER PR DynaLoader.c(lib/auto/DynaLoader/DynaLoader.a[DynaLoader.o])
                                   0000192c .text    R_RBR    [42]    <.readExports>
ER: The return code is 8.

Am I just missing some switch on taht 'cc' command, or 
has AIX 4.3 gone radically different? I am an AIX newbie.


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

Date: 24 Feb 1998 19:51:22 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: Avoiding $`
Message-Id: <6cv8bq$g8o@news.service.uci.edu>

In article <34F1122A.D06BD478@coos.dartmouth.edu>,
Chipmunk  <rjk@coos.dartmouth.edu> wrote:

>And when the original poster starts using /s and /g, or strings with embedded
>newlines, suddenly the solution he got from clpm will stop working.  It's okay
>to make assumptions, *when they are warranted*.  In this case, we want an
>alternative for $`, $&, and $'.  Any solution we come up with should work in
>*all* situations in which $`, $&, and $' might be used.

And those solutions can be convoluted.  Using $`, $&, and $' can lead
to cleaner code in some cases (even though performance is hurt).

What I would like to see is a new regex modifier that instructs the
Perl interpreter to not set $`, $&, and $', regardless if it used
elsewhere.  This way I can use $`, $&, and $' in cases where it is
useful, but eliminate the performance penalty in other regexs that do
not need it.

	--ewh
-- 
             Earl Hood              | University of California: Irvine
      ehood@medusa.acs.uci.edu      |      Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME


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

Date: Tue, 24 Feb 1998 22:17:51 GMT
From: mocat@NOSPAM.best.com (blacktape)
Subject: Re: better way to do this?
Message-Id: <34f346c8.8233588@nntp.best.com>

On Sat, 21 Feb 1998 20:47:44 -0500, see-below@crocker.com (Steve
Linberg) wrote:

>In article <34ef6e05.687476@nntp.best.com>, mocat@NOSPAM.best.com
>(blacktape) wrote:
>
>> After learning a bit more about regexps, I've started work on a script
>> that'll clean up my html files a bit.  I was wondering if there is a
>> better way to do this... I know it's crude, but it works. ;)
>
>What about this:
>
><p>here is some HTML causing the IMG tag to wrap: <img
>src="/foo.gif"></p>

i thought about this, how could i make the script catch such hidious
html code such as that?
i've been reading a bunch and can't find anything that would allow me
to do that...
thx


-j
the dumber a person is, the longer it will take for them to find out that you're killing them


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

Date: Tue, 24 Feb 1998 22:30:18 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: CGI.pm a part of Perl (was Re: Cookies)
Message-Id: <34f445ad.7607057@news.tornado.be>

charlot@CAM.ORG (Richard Bellavance) wrote:

>Andrew M. Langmead <aml@world.std.com> wrote:

>>       CGI is a part of the base Perl installation. 

>>I personally feel it was a poor choice, but apparently the decision
>>has been made. "CGI.pm" is now as much of a part of perl as <string.h>
>>is a part of C.

>I feel the same way.  The Perl gurus try very hard to distinguish Perl from
>CGI, and then they make CGI.pm part of the base Perl distribution...  Granted,
>it's more convenient, especially considering that a lot of new Perl
>installations are for CGI programming anyway.  But wouldn't it be a Good 
>Thing to "force" new users to go through www.perl.com and CPAN to get it ?
>Once there, who knows, they might even see the FAQ !

CGI.pm is part of the distribution. But it's a module. Modules are NOT
part of Perl. They are merely additions, written in plain Perl (= plain
text).

I think it's important to stress this fact toward newbies: modules are
not sealed black boxes. It might be interesting to have a look at their
code. Even if eventually you end up not using them.

BTW the FAQ is part of the distribution too.

	Bart.


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

Date: 24 Feb 1998 21:34:51 GMT
From: dannyman <dannyman@arh0300.urh.uiuc.edu>
Subject: Re: Cookies
Message-Id: <6cvedr$7tq$9@vixen.cso.uiuc.edu>

Andrew M. Langmead <aml@world.std.com> wrote:

> I personally feel it was a poor choice, but apparently the decision
> has been made. "CGI.pm" is now as much of a part of perl as <string.h>
> is a part of C.

That's pretty cool: your statement just made me dizzy. :D

-- 
  //Dan   -=-     This message brought to you by djhoward@uiuc.edu    -=-
\\/yori   -=-    Information - http://www.uiuc.edu/ph/www/djhoward/   -=-
aiokomete -=-   Our Honored Symbol deserves an Honorable Retirement


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

Date: 24 Feb 1998 22:14:28 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Detecting Video Settings
Message-Id: <6cvgo4$lvg$1@comdyn.comdyn.com.au>

In article <6ctff2$vfq$1@sampo.creighton.edu>,
	psamuels@sampo.REMOVETHIS.creighton.edu (Peter Samuelson) writes:

> [Martien Verbruggen <mgjv@comdyn.com.au>]
>> Ask them to upload their registry. Read it. Extract the information
>> from it. Of course, it won't work if the connecting person doesn't
>> have a PoB program loader.
> 
> No go.  You're assuming the person at the other end has his/her web

Maybe I should have put <sarcasm></sarcasm> tags around it? I hoped it
was clear enough. Besides, this group doesn't talk about CGI, HTML,
HTTP or any of that stuff, normally.
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Begin at the beginning and go on till
Commercial Dynamics Pty. Ltd.       | you come to the end; then stop.
NSW, Australia                      | 


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

Date: 24 Feb 1998 20:42:55 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: factorial function?
Message-Id: <6cvbcf$ef9$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Paulo Dutra 
<paulo@xilinx.com>],
who wrote in article <34F1EE66.86C2EEF@xilinx.com>:
> Is there a recommended library to handle factorial implementations?
> --
> Paulo                                      //\\\\
>                                            | ~ ~ |
>                                           (  O O  )
>  __________________________________oOOo______( )_____oOOo_______
> |                                             .                 |
> | / 7\'7 Paulo Dutra (paulo@xilinx.com)                         |
> | \ \ `  Xilinx                              hotline@xilinx.com |
> | / /    2100 Logic Drive                    (800) 255-7778     |
> | \_\/.\ San Jose, California 95124-3450 USA (408) 879-6797     |
> |                                                  Oooo         |
> |________________________________________oooO______(  )_________|
>                                          (  )       ) /
>                                           \ (      (_/
>                                            \_)
> 
> 


perl -MMath::Pari=ifact -le "print ifact 1000"
[many lines skipped]
59826280956121450994871701244516461260379029309120889086942028510640182154399457156805941872748998094254742173582401063677404595741785160829230135358081840096996372524230560855903700624271243416909004153690105933983835777939410970027753472000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Ilya


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

Date: Tue, 24 Feb 1998 16:21:56 -0500
From: Douglas Cordero <dcordero@giss.nasa.gov>
Subject: HELP array stuff
Message-Id: <34F339F4.41C6@giss.nasa.gov>

Hi!  
I am going crazy with this one.  
I have 2 arrays:
@array1		@array2
1234.4		GHI.92.2345.0.92
2345.0		DEF.91.0298.2.91
0298.2		ABC.89.1234.4.89

1) Normally, they should be the same size.
2) The contents of @array1 should be somewhere in @array2.
3) If the contents of @array1 aren't in @array2, alert user.

I came up with this, but it doesn't work:

foreach $A1 (@array1) {
        $found = 0;
        foreach (@prodata) {
                if (m/$A/) {
                        $found = 1;
                        last;
                }
        }
        if( $found == 0 ) 
		{ die "MISSING DATA\n" }
}

Any ideas where I am screwing this rather easy task up?

Thx.
Doug C.


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

Date: Tue, 24 Feb 1998 16:30:43 -0500
From: Ameer Sulaiman <asulai@ctp.com>
To: Adam Donahue <donahue@acf2.nyu.edu>
Subject: Re: HELP: Modules load as root, not user.
Message-Id: <34F33C03.4580@ctp.com>

Adam Donahue wrote:
> 
> Hi,
> 
> I'm having a problem running various modules as a regular user, but they
> run fine as superuser.  For example:
> 
> If I run this trivial Perl script:
> 
> #!/usr/bin/perl
> use GD;
> 
> as root, it does what it's supposed to.  (Well, assume I actually make an
> image using the GD functions.)  However, if I run it as a regular user, I
> get an error:
> 
> Can't locate loadable object for module GD in @INC (@INC contains:
> /usr/local/lib/perl5/sun4-solaris/5.00404 /usr/local/lib/perl5
> /usr/local/lib/perl5/site_perl/sun4-solaris/usr/local/lib/perl5/site_perl .) at - line 1
> BEGIN failed--compilation aborted at - line 1.
> 
> Now, I thought it might be the root path, but @INC is the same for both
> root and the regular user.  I usually "su" and then "csh; source ~/.cshrc"
> to load my defaults anyhow.  But I've made sure that any environment
> variables in the root account are present in the user account.  So I
> thought it might be a wacky permissions setting.  But as far as I can
> tell, the permissions line up for both root and other users.  (root has
> write access to various Perl directories, but usually all three classes
> either have r access or rx access.)
> 
> Anyhow, I'm stumped.  How do I fix this?  It's not just GD;  it's
> happening with other modules as well.  And it's always in loading an
> object module, not the module itself.  (That would result in a different
> error.)
> 
> Any ideas?
> 
> Thanks,
> Adam
Check the rights/permissions on ALL of the module files. Its likely that
they are set to read only for owner(in this case root). 

Ameer


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

Date: 24 Feb 1998 21:11:28 GMT
From: chris+usenet@netmonger.net
Subject: Re: How to get the encrypted password string ?
Message-Id: <6cvd20$7sp$2@schenectady.netmonger.net>

In article <34f14aad.612539585@news>,
Baher M. Safwat <bsafwat@egyptonline.com> wrote:
> I use Solaris 2.5.1 on Sun Ultra1 ,
> when using the perl function to get the password of a certain user
> it return the "x" from the /etc/passwd  file instead of the encrypted
> string from the /etc/shadow

Only root can read the encrypted password.
-- 
	       Christopher Masto <chris@netmonger.net>
	Director of Operations, NetMonger Communications, Inc.
    +1-516-221-6664  http://www.netmonger.net/  info@netmonger.net


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

Date: Tue, 24 Feb 1998 15:21:43 -0600
From: schwern@starmedia.net
To: apps@starmedia.net
Subject: Re: Internationalization
Message-Id: <6cvdkv$cae$1@nnrp1.dejanews.com>

So for those of you still interested... here's how to pull off the GNU gettext
+ gettext.pm + locale solution I'm using.  Its really rather simple and the
procedure is decently documented in the gettext.pm README and the GNU gettext
info docs... but who wants to read manuals anymore? :)


1)  Make sure your computer has locale support.  Bug your sysadmin for
details.
2)  Make sure your perl has locale support (see perllocale man page).
3)  Install GNU's gettext utilities suite.  This handy little package comes as
a RedHat5 package (that's how I got it) so I don't know the details of
installation... autoconfig usually handles everything anyway.
4)  Install gettext.pm from
/CPAN/modules/by-authors/id/PVANDRY/gettext-1.00.tar.gz  READ THE README!
5)  Write your internationalized script with the apropriate gettext, POSIX and
locale modules included... below's an I18N'd Hello World script...


#!/usr/bin/perl

use POSIX;
use gettext;

# Point to our local locale directory and use the file set test_messages
bindtextdomain('test_messages', '/home/schwern/work/perl/locale');
textdomain('test_messages');

# Use the .mo files located in <locale_dir>/<LANG>/LC_MESSAGES
# where <locale_dir> is that specified in bindtextdomain and <LANG> is
# the temporary env variable specified at the command line.
setlocale(LC_MESSAGES, '');

print gettext("Hello, world!"), "\n";


6)  Run xgettext on your script.  This produces a file called messages.po
which looks something like...


msgid ""
msgstr ""
"Date: 1998-02-24 14:08:36-0500\n"
"From: Michael G Schwern,29 W 36th St.  5th floor,(212)548-9643,(516)499-1577
<schwern@rocinante.starmedia.com>\n"
"Content-Type: text/plain; charset=\n"
"Xgettext-Options: \n"
"Files: hello_world.pl\n"

#: hello_world.pl:13
msgid "Hello, world!"
msgstr ""


7)  Make as many copies of message.po as you wish to have translations, and
give a copy to each of your translators (or do it yourself if you're so
talented.  I'm a stupid american, I only know English.)  Fill in the
translation at each "msgstr".

8)  Compile your .po files with msgfmt, place them into either the shared
locale directories (something like /usr/lib/locale or /usr/share/locale) or
into a local locale directory specified with bindtextdomain().  For instance,
to make my Spanish and Porteguese translations I did...

cd /home/schwern/work/perl
mkdir -p locale/es/LC_MESSAGES
msgfmt message.po.es -o /locale/es/LC_MESSAGES/test_messages.mo
mkdir -p locale/pr/LC_MESSAGES
msgfmt message.po.pr -o /locale/pr/LC_MESSAGES/test_messages.mo

9)  Yer done.  Either set your LANG environment variable or use some other
locale scheme to set your locale/language/whatever.

[schwern@rocinante perl]$ perl hello_world.pl
Hello, world!
[schwern@rocinante perl]$ LANG=es perl hello_world.pl
Hola, mundo!
[schwern@rocinante perl]$ LANG=pr perl hello_world.pl
Oi, mundo!


Actually... I'm cheating there.  I'm getting some warnings.  Here's the real
output...

[schwern@rocinante perl]$ perl hello_world.pl
Hello, world!
[schwern@rocinante perl]$ LANG=es perl hello_world.pl
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LC_ALL = (unset),
        LANG = "es"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Hola, mundo!
[schwern@rocinante perl]$ LANG=pr perl hello_world.pl
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LC_ALL = (unset),
        LANG = "pr"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Oi, mundo!


But they seem to be a fault of my configuration.  If anyone knows what the
hell that means, please offer me your suggestion.

Ta da!  I18N/L10N in 9 easy steps <insert grain of salt here>.  Its compatible
with existing systems, uses existing modules/utilities, new languages can
simply be popped in and makes sense.  I haven't benchmarked it for speed or
anything, but I would suspect that on any RealOS, memory management will
simply cache the .mo databases if the gettext'd program is run often enough.


Many, many thanks to Mr Vandry for writting the gettext.pm wrapper module!  I
just wish he'd put it in a more accessable location.

----

Stupidity Hath Its Privledges.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 24 Feb 1998 20:28:53 GMT
From: Larry Riedel <larryr@ucsd.edu>
Subject: Re: Java's hidden flaw
Message-Id: <6cvai5$pil$2@prefetch.san.rr.com>

> Java's creator says the software was never intended to be a
> commercial product.
 
What is "the software"?  I don't recall having any obligation
to pay money toSun for using, developing, or selling Java
software.  Is this a hidden flaw in the language?
 
 
Larry
 


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

Date: Tue, 24 Feb 1998 17:38:35 -0500
From: Li Sen <sen@ftd.com>
Subject: max limit on dbms open?
Message-Id: <34F34BEB.2781@ftd.com>

Hi all,

Is there a Perl limit on how many dbms that can be opened at any given
time?  Or is this an OS limit?  (I'm running Solaris 2.6).

The problem:
I need to open many dbm files (with tie or dbmopen).  However, at times
that I have opened more than 30 or so dbms, I can't seems to access that
dbm.  That is, I can't even loop through the keys.

Would any one know the explanation?




Thanks in advance!

Li


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

Date: Tue, 24 Feb 1998 16:42:11 -0600
From: geobo@els.liu.se
Subject: Memory allocation and garbage collection
Message-Id: <6cvic3$hpf$1@nnrp1.dejanews.com>

Hi,

I have a problem understanding the way perl handles memory. Perlfaq3 says:

      However, judicious use of my() on your variables will help make sure
      that they go out of scope so that Perl can free up their storage for
      use in other parts of your program.

If I run the program below, I thought that the space allocated for $tmp would
be reused in each subX.

      #!/usr/local/bin/perl -w

      my $ps_command = "ps -l | grep $$ | grep -v grep | grep -v sh";
      my $big = 'X' x 5000000;

      sub1(); print `$ps_command`;
      sub2(); print `$ps_command`;
      sub3(); print `$ps_command`;
      sub4(); print `$ps_command`;
      sub5(); print `$ps_command`;

      sub sub1 {my $tmp = $big;}
      sub sub2 {my $tmp = $big;}
      sub sub3 {my $tmp = $big;}
      sub sub4 {my $tmp = $big;}
      sub sub5 {my $tmp = $big;}


But the output is as follows:

100000   500 20169  8424   9   0  16104 15368 pipe_read   S   pd  0:00 perl
100000   500 20169  8424   3   0  20992 18932 pipe_read   S   pd  0:00 perl
100000   500 20169  8424   1   0  25876 21412 pipe_read   S   pd  0:00 perl
100000   500 20169  8424  10   0  30760 24052 pipe_read   S   pd  0:01 perl
100000   500 20169  8424   2   0  35644 26860 pipe_read   S   pd  0:01 perl
                                    ^
                                    |
                                  SIZE

Could someone please explain why the memory for $tmp not gets freed?
I must be missing something...

Thanks in advance,
/Georg


BTW. Tested with 5.004_01 (Linux), 5.004_04 (Linux) and 5.004_01 (HP-UX)

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 24 Feb 1998 20:38:09 GMT
From: <bp@bp.com>
Subject: Pattern Match
Message-Id: <01bd4164$08062f40$064763a1@amancw15580.anc.xwh.bp.com>

I have a series of lines of data that start with

" D-01    1456"
" D-02    1500"
" D-04    1400"

I want to keep the D-01 as one word.  How would I match this or parse it in
perl?

Bruce
laughlba@bp.com


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

Date: 24 Feb 1998 22:24:37 GMT
From: manhattan5@aol.com (Manhattan5)
Subject: Pattern Matching for parsing tags 
Message-Id: <19980224222401.RAA09551@ladder03.news.aol.com>

Hello,

Sometimes they pattern matching works, sometimes it doesn't. For example this
worked:

 $myfile =~ s/<HR>/<hr size=1 noshade>/g;

This didn't:

$myfile =~ s/<[BODY bgcolor=\"FFFFFF\"]>/ /g;

Any ideas how to parse a specific tag? I know general tags by <[^>]*> but am
having trouble with specific.

My e-mail address is mike@vitamins.netX minus the "X" at the end. Thank you in
advance for any advice.

Regards,

Michael



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

Date: 24 Feb 1998 20:53:57 -0000
From: chrisb@jesmond.demon.co.uk (Chris Benson)
Subject: Re: Perl training UK
Message-Id: <6cvc15$vpa@jesmond.demon.co.uk>

In article <34f0ab05.12401627@news.ftech.net>,  <robert@cornell.co.uk> wrote:
>"nospam" <nospam@no.spam> wrote:
>
[...]
>>
>>We have not found any other places in the UK fro training.
>
>For the record - Learning Tree do a 4 day Perl course in Hammersmith,
>London.
>
 ... also 5 days from CAP Gemini Training in Victoria [*]

[*] I have an interest to declare.
-- 
Chris Benson


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

Date: Tue, 24 Feb 1998 11:59:21 -0800
From: Chuck Chiang <ctc@cisco.com>
Subject: problem with attrs locked method
Message-Id: <34F32699.3DEE@cisco.com>

Hi, 

I am using version 5.004_56 of perl and the debugger seems not to
work with a function that is 'locked' and 'method'. The following
program does not work if run in the debugger. It seems to think that
there is no argument to the foo function.

I would appreciate if someone can tell me what I did wrong or suggest
a work around. It would be great if you can CC:ctc@cisco.com when
you reply.

thanks very much
--chuck

sub foo {
    use attrs qw( locked method );
}

foo(1);
@a = attrs::get(\&foo);
print @a, "\n";





ctc@ctc-ultra:/nfs/gsg-hw/users/ctc/perl5.004_56/ext/attrs> ../../perl
test.pl
methodlocked
ctc@ctc-ultra:/nfs/gsg-hw/users/ctc/perl5.004_56/ext/attrs> ../../perl
-d test.pl

Loading DB routines from perl5db.pl version 1.02
Emacs support available.

Enter h or `h h' for help.

main::(test.pl:5):	foo(1);
  DB<1> c
no argument for locked method call at /mytmp/local/lib/perl5/perl5db.pl
line 1176, <IN> chunk 1.
DB::fake::(/mytmp/local/lib/perl5/perl5db.pl:2138):
2138:	  "Debugged program terminated.  Use `q' to quit or `R' to
restart.";
  DB<1> q
ctc@ctc-ultra:/nfs/gsg-hw/users/ctc/perl5.004_56/ext/attrs> >


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

Date: Tue, 24 Feb 1998 22:27:32 +0100
From: "Jesper" <j.rasmussen@netjob.dk>
Subject: PWS , WINDOWS95 and PERL
Message-Id: <34f33cda.0@news4.image.dk>

Hello all you  PERL people !

I have one easy question for you:

I have perl build 315 installed and PWS too.
I do have a problem making PWS run perl programs. When I click a .pl in my
browser it says HTTP/1.1 500 Server Error


AND I HAVE changed the REGISTRY
system/currentcontrolset/services/w3svc/parameters/script map to include a
path to the perl program. Extention .pl

HOW CAN I MAKE Microsoft Personal Webserver run perl programms ??

I am running windows98 and I do not have windows NT (no IIS)

If you can't answer this question - How do all your perl programmers test
your CGI on a server? Do you all use windowsNT 's IIS ?

Jesper





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

Date: Tue, 24 Feb 1998 20:05:42 GMT
From: alex@gossamer-threads.com (Alex Krohn)
Subject: reg expression help..
Message-Id: <34f3245c.3139472@news.supernews.com>

Hi,

I'm writing a search script that searches over a flat file database.
It has several options that can be passed in. I'm trying to move the
options out of the main loop, and prebuild a reg expression.

I have the following options:

	whole word searching: add a \b \b around the search term.
	case sensitive: add a /i to the reg expression
	reg expression: don't use a \Q \E around search term, also put
eval around reg expression so it doesn't crash if bad re.

What I'm doing now is:

foreach $line (@lines) { # of the databse
  @values = &split_decode ($line);  # Get the data
  foreach $field (@search_fields) {
    if ($in{'re'}) {        # reg expression
      if ($in{'cs'} {      # case sensitive 
         $match = eval { $values[$field] =~     
                 /$search{$db_cols[$field]}/i; };
     }
     else {
         $match = eval { $values[$field] =~
                  /$search{$db_cols[$field]}/; };
   }
  else {

 ...

I think you get the point.. I'd love to remove as many of the if's as
possible from the main loop, and somehow prebuild the reg expression.

I think I could do something like:

my ($regexp) = "word";
$regexp = "\Q$regexp\E" if (!$in{'re'});
$regexp = "\b$regexp\b" if ($in{'ww'});
$regexp = "(?i)$regexp" if ($in{'cs'});

and then in the for loop:

$expr = $regexp;
$expr = s/word/$term/;
eval { $match = ($values[$field] =~ /$expr/)  };

Does that make sense? Does putting an eval in there every time make
things worse then before?

Thanks for any insight on this..

Cheers,

Alex

	





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

Date: Tue, 24 Feb 1998 21:47:49 GMT
From: wrdcom@clara.net (Sean Ahern)
Subject: Re: The Ineffable Tom C.
Message-Id: <34f33e5c.1759735@news.clara.net>

On Tue, 24 Feb 1998 14:17:44 +0000, Brendan Knox <knoxb@pecc.co.uk>
wrote:



>Maybe we should form comp.lang.perl.newbies.  Your opinion will change
>when you see such newbies ask the same question week after week.  Why
>should any of us have to refrain from being sarcastic to people that
>haven't
>tried to find out themselves? 

      Politeness?

 Furthermore, if anyone is hurt to the
>point
>of dismissing Perl and/or this newgroup to sarcasm, then you really have
>to
>wonder what type of person they are. 

    Beginners, not used to being treated as imbeciles just for not
having the same knowledge base as you have?


 Perhaps if they can't take the
>heat,
>they too should get out of the kitchen.

   Maybe they just believe what they read.  ie  the first to third
paragraphs of page xxvii of the book most people recommend them when
they start to learn perl?  Thats 'Learning Perl' 2nd edition... 

>
>That said, I understand your opinion, but I don't agree with it.  Most
>of the 
>newbies in any newsgroup have never taken the time to bother looking at
>any 
>form of documentation be it manpages, online web pages, textfiles or
>books.

  Proof?

>If they have tried, I'd be quite amazed, as most of this stuff is easy
>to find
>and easy to understand.

    From the perspective of one who already understands.

  If it isn't... well that's a whole other rant
>about
>people being allowed to access programming languages and interpreted
>scripting
>tools. :>

   Aaaaah, its elitist time....

      
The Once, and Future,
    White Rabbit


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

Date: 24 Feb 1998 22:33:35 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: The Ineffable Tom C.
Message-Id: <6cvhrv$3rd$1@csnews.cs.colorado.edu>

In comp.lang.perl.misc, SxA@wrdcom.clara.net writes:
:   Aaaaah, its elitist time....

    dos2unix("elitist")   => "competant"
    unix2dos("competant") => "elitist"

Or, if you prefer:

    rabble_to_professional("elitist")   => "competant"
    professional_to_rabble("competant") => "elitist"

--tom, wondering whose elitist time was referenced above
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

if (shm == (char *)-1)  /* I hate System V IPC, I really do */
    --Larry Wall, from doio.c in the v5.0 perl distribution


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

Date: Tue, 24 Feb 1998 21:13:47 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: ts: double vs single quotes
Message-Id: <EowIyz.F5r@world.std.com>

Some guy whose e-mail address is a tasteless and malicious joke wrote:

> Is there enough of a performance
>penalty here that I should consider using single-quoted strings
>by default?

The difference is only in the amount of time it takes to compile the
script. Once the script is running, double quotes that perform no
variable interpolation and single quotes identical. You can see this
if you compile perl with the -DDEBUGGING option and run it with the
appropriate -D flag. (I keep around a special debugging version of
perl around to investigate things like this.)

#!/usr/bin/perl

$a = "double quotes";
$b = 'single quotes';

EXECUTING...
 
    =>
(quotetest:0)   enter
Entering block 0, type BLOCK
    =>
(quotetest:0)   nextstate
    =>
(quotetest:3)   const(PV("double quotes"))
    =>  PV("double quotes")
(quotetest:3)   gvsv(main::a)
    =>  PV("double quotes")  $b
(quotetest:3)   sassign
    =>  PV("double quotes")
(quotetest:3)   nextstate
    =>
(quotetest:4)   const(PV("single quotes"))
    =>  PV("single quotes")
(quotetest:4)   gvsv(main::b)
    =>  PV("single quotes")  $b
(quotetest:4)   sassign
    =>  PV("single quotes")
(quotetest:4)   leave
Leaving block 0, type BLOCK


Despite this, my personal, unwritten, style guidelines specify that
double quotes are only to be used for interpolation and backslash
interpretation. Then when I'm reading my code I can quickly see what
function the quoting is performing.

-- 
Andrew Langmead


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

Date: Tue, 24 Feb 1998 16:12:57 -0500
From: Dan Boorstein <dboorstein@shopcfn.com>
Subject: Re: ts: double vs single quotes
Message-Id: <34F337D9.5FB42701@shopcfn.com>

tsatan@hotmail.com wrote:
> 
> As a C programmer I am in the habit of using only double-quoted
> strings in perl. Such strings are subject to variable interpolation
> and backslash interpretation. Is there enough of a performance
> penalty here that I should consider using single-quoted strings
> by default?

i doubt the performance is altered significantly for it to be a
driving force in the (non)usage of single quotes. my rule is that
i only use interpolating quotes when interpolation is useful within the
quotes. this way i can quickly scan for variable locations, skipping
any single quotes i see. also, i just find ' to be cleaner in appearance
than ". though i do tend to avoid explicit concatenations:

  $potato = "i am a $monkey";
    instead of
  $potato = 'i am a ' . $monkey;

as well as 'print' with commas:

  print "i am a $monkey";
    instead of
  print 'i am a ', $monkey;

again because i find them cleaner in appearance,

cheers,

-- 
dan boorstein <dboorstein@shopcfn.com>


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

Date: 24 Feb 1998 20:09:29 GMT
From: burt@ici.net (Burt Lewis)
Subject: Win95 - Running scripts from browser?
Message-Id: <6cv9dp$s1u$1@bashir.ici.net>

Hi,

I just installed Perl in Windows95 and all is great running from the DOS 
prompt.

Problem is when I try to open a script in my browser, it wants to open it in 
Notepad.

I have the script in the bin directory. Is there something I'm missing or 
need to do to get this to execute via a browser.

Burt



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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.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 1966
**************************************

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