[10088] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3681 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 10 14:07:49 1998

Date: Thu, 10 Sep 98 11:00:17 -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           Thu, 10 Sep 1998     Volume: 8 Number: 3681

Today's topics:
        Efficiency of subject line change program <george@tapestry.net>
    Re: Help! WinNT/95 question re: benchmark.pm <JKRY3025@comenius.ms.mff.cuni.cz>
        HELP: perlsec and insecure dependency <news@paintbot.com>
    Re: History of Perl - round 1 <perlguy@inlink.com>
        how to be a CS major cactuskid33@my-dejanews.com
    Re: library <JKRY3025@comenius.ms.mff.cuni.cz>
    Re: Objects & type checking <mark@satch.markl.com>
    Re: oraperl ==> perl5 + DBI + DBD (Jacqui Caren) (Jacqui Caren)
    Re: Passing file handles (M.J.T. Guy)
    Re: Perl & Java - differences and uses <borg@imaginary.com>
    Re: Perl & Java - differences and uses <perlguy@inlink.com>
        QUESTION: Perl 5 for Win32 <nbell@acad.stedwards.edu>
    Re: Realtime Parsing Syslog for ftp logins <eashton@bbnplanet.com>
    Re: Realtime Parsing Syslog for ftp logins <eashton@bbnplanet.com>
    Re: Realtime Parsing Syslog for ftp logins <root@kam.xvi.com>
    Re: Realtime Parsing Syslog for ftp logins <poc@quay.ie>
    Re: sprintf error in Perlis and PerlScript <aqumsieh@tigre.matrox.com>
    Re: System call in PERL <JKRY3025@comenius.ms.mff.cuni.cz>
    Re: Which database to use with Perl for Win32 (Jacqui Caren) (Jacqui Caren)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 10 Sep 1998 17:39:05 GMT
From: "George H" <george@tapestry.net>
Subject: Efficiency of subject line change program
Message-Id: <01bddce0$e261fee0$8395cdcf@hp-customer>

I have the following program that I have been using to alter Subject lines
of messages as they arrive to a certain mailbox on my server.  People reply
to our opt-in lists with messages including a 6-digit ID#  in the subject
line but everyone uses different ways of putting that number in the subject
line (ex.: id=222222 or ID#222222 or whatever).  I wanted client-end-user
viewing the messages to see a similar subject line so I wrote the following
program to extract the ID# from the subject line and rewrite it in a common
format.  The end users love it ... but since I am relatively new to
programming and perl, I was wondering if they way I did it is not very
efficient.  I mean 'printing' every line to a mail pipe may be bad use of
resources.  I am asking because I may expand this to do some other things
and I haven't really found any references telling me whether or not this is
efficient.  


#!/usr/bin/perl5 -w

my $address = "foo@bar.com"; #final destination address

open(MAIL, "|/usr/lib/sendmail $address") or die "Could not run sendmail.";
while (<STDIN>) 
{
	if (/^Subject:/ && /\D(\d{6})\D/)
	{
	print MAIL "Subject: Response for ID\#" . $1;
	print MAIL "\n";
	next;
	}
	else {print MAIL $_;}
}
close (MAIL);
exit;

Thanks for your help in advance,

George


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

Date: Thu, 10 Sep 1998 19:34:27 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: Help! WinNT/95 question re: benchmark.pm
Message-Id: <35F88C33.68E2@comenius.ms.mff.cuni.cz>

Matt Giamporcaro wrote:
> 
> I'm relatively new to the Perl scene, and I am having problems using the
> Benchmark module to measure the efficiency of some algorithms, using
> timeit(), timethis(), etc. For example, when I try the following:
> 
>     $t0 = new Benchmark;
> 
> I get the error message: "times not implemented at Benchmark.pm line
> 274".
> 
> I have the same problem when I try to use timeit() and $timethis(). Is
> it possible that the WinNT port doesn't support the times() function? Do
> I have to throw out my Microsoft products and use a real OS? Can anyone
> suggest a better course of action?
> 
> Thanks,
> Matt Giamporcaro
> mattg@alum.mit.edu

You have the AS port of perl build 3xx, don't ya?
You do not dare to have a 1xx build or even the perl from WinNT ResKit
!?!
Upgrade is in order.

I didn't have any problems using Benchmark.pm using the GS port
(see http:/www.perl.com/CPAN/ ) 5.00402 - hope I remember the number
well.
I believe that the new ActivePerl build 5xx works OK in this regard as
well.

HTH, Jenda


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

Date: Thu, 10 Sep 1998 13:05:21 -0400
From: "Paintbot" <news@paintbot.com>
Subject: HELP: perlsec and insecure dependency
Message-Id: <6t90sr$qo2$1@ash.prod.itd.earthlink.net>

I'm getting strange tainting problems with the following.  The key here is
that the result of the grep is NOT tainted, but when assigned to an array,
it IS tainted.  I'm just beginning perl, so feel free to be verbose. Thanks.
Oh, and please cc your reply to me by mail.

sub RemoveOldSessions
{
local(@files, $file);

print "files: ",&is_tainted(@files),"\n";
print "auth_session_dir: ", &is_tainted($auth_session_dir),"\n";

# Open up the session directory.
opendir(SESSIONDIR, "$auth_session_dir") ||
 &CgiDie("Session Directory Would Not Open\n");

# read all entries except "." and ".."
@files = grep(!/^\.\.?$/,readdir(SESSIONDIR));

print "readdir: ",&is_tainted(readdir(SESSIONDIR)),"\n";
print "files: ",&is_tainted(@files),"\n";
print "grep: ",&is_tainted(grep(!/^\.\.?$/,readdir(SESSIONDIR))),"\n";

closedir(SESSIONDIR);

print "files: ",&is_tainted(@files),"\n";
print "auth_session_dir: ", &is_tainted($auth_session_dir),"\n";

# Go through each file
foreach $file (@files)
{
# If it is older than auth_session_length, delete it
        if (-M "$auth_session_dir/$file" >
               $auth_session_length)
        {
                unlink("$auth_session_dir/$file");
        }

}
} # End of RemoveOldSessions


running the program gives me the following:

files:
auth_session_dir:
readdir:
files: 1
grep:
files: 1
auth_session_dir:
Insecure dependency in unlink while running with -T switch at
 ./Library/auth-extra-lib.pl line 337, <USERFILE> chunk 10.

I got the is_tainted from the perlsec man page.

    sub is_tainted {
        return ! eval
    {
            join('',@_), kill 0; # those are two single quotes
            1;
        }
    }





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

Date: Thu, 10 Sep 1998 16:51:20 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: History of Perl - round 1
Message-Id: <35F80388.B060377B@inlink.com>

> > You're deluding yourself if you think you're avoiding capitals for any
> > reason other than "style".  Because I haven't seen any scarcity of
> > :"<>?~!@#$%^&*()_+{}| characters in your writing (all of which, you
> > know, require the use of the Shift key -- at least on most std kbds.)

Not if you get the new "Perl keyboard"!!!

The :"<>?~!@#$%^&*()_+{}| keys have replaced the asdfghjklqwertyuipo
keys.  You now have to use Shift for the letters :^)

Only $19.95 from Ronco.

(Some assembly required)
(Use only under close adult supervision)
(No MSG's)
-- 
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$            Brent Michalski             $
$         -- Perl Evangelist --          $
$    E-Mail: perlguy@technologist.com    $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$


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

Date: Thu, 10 Sep 1998 17:44:44 GMT
From: cactuskid33@my-dejanews.com
Subject: how to be a CS major
Message-Id: <6t936c$ejh$1@nnrp1.dejanews.com>

it's all here >:) How to become a successful computer science major (its just
humor chill out hehe)

http://www.gl.umbc.edu/~blorra1/geek.html

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


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

Date: Thu, 10 Sep 1998 19:38:46 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: library
Message-Id: <35F88D36.211D@comenius.ms.mff.cuni.cz>

Robert wrote:
> 
> Hi
> 
> I'm trying to do a library, but things aint going to well.
> Here is my problem.
> 
> I want a subroutine that prints out some html.
> This subroutine should be in a file called "intranet.lib"
> and it look like this:
> 
> # Intranet Subroutines
> 
> sub Return_HTML {
> 
> print "content-type: text/html\n\n";
> 
> local ($title, $headline, $text) = @_;
> 
> print<<end;
> 
> <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 3.2 Final//EN'>
> <HTML>
> <HEAD>
> <TITLE>$title</TITLE>
> <LINK REL=STYLESHEET HREF="/global.css" TYPE="text/css">
> <META NAME="author" content="Robert Lindgren, Stockholms
> Handelskammare">
> <META name="generator" content="Super NoteTab">
> <BODY>
> <H1 CLASS="headline">$headline</H1>
> <P>$text</P>
> </BODY>
> </HTML>
> 
> end
> }
> 
> When I call this from the main script like this:
> &Return_HTML("Done", "You are ready", "this is only a test");
> 
> I get the following error message:
> intranet.lib did not return a true value
> 
> It works fine if I put the same subroutine in the main script.
> I also stated
> require "intranet.lib";
> in the main script
> 
> What am I doing wrong here?

Failing to RTFM.
 
> Thanks in advance
> 
> Robert

man perldiag
 ...
       %s did not return a true value
           (F) A required (or used) file must return a true value
           to indicate that it compiled correctly and ran its
           initialization code correctly.  It's traditional to
           end such a file with a "1;", though any true value
           would do.  See the require entry in the perlfunc
           manpage.
 
HTH, Jenda


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

Date: 10 Sep 1998 13:44:33 -0400
From: Mark Lehrer <mark@satch.markl.com>
Subject: Re: Objects & type checking
Message-Id: <m3zpc7hnge.fsf@satch.markl.com>

Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> writes:

> > Hello.  I am new to using perl objects (i've read the simple docs
> > on cpan about a dozen times each and implemented a few classes).
> 
> try 'perldoc perltoot'. tchrist's oop tutorial. well done and easy to
> read and understand. 

Perhaps it seems that way to someone who is already familiar with OO
Perl.  It answers a few questions but leaves a lot to be desired (my
opinion of course).

>> My question: how can I best implement type checking?  In
>> particular, I am used C++ and having the same function name with
>> several different sets of arguments.
> 
> hrm. C++ is not Perl. Bad Thinkage.

Perhaps you could be a bit more helpful instead of stating the
obvious.  I am asking for a recommendation on why and what the
"correct" way to accomplish the same thing might be.  Maybe I can
write a C++ User's introduction to OO Perl after I figure this stuff
out.

For example, I have an object that could be constructed in several
different ways.  In C++, I would make three different constructors
that take different arguments.  In Perl, it looks like I'll have to
make a special factory class that has a different-named method for
each constructor; or else I'll have to look at the @ISA array for each
argument and do something different based on each possible combination
of argument types.  This doesn't seem like the lazy programmer's way
to do it.

>> In order to do this in Perl, do I have to do something really
>> painful like going through the @ISA array for each argument?  Yuck.
> 
> Why have an object without a method? Read perltoot. You'll be happy
> you did.

That is not what I'm saying; I'm saying that I want to use the same
method name with different argument types, without having to make an
if statement to see what type of object each argument is.

Mark


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

Date: Thu, 10 Sep 1998 16:35:25 GMT
From: Jacqui.Caren@ig.co.uk (Jacqui Caren) (Jacqui Caren)
Subject: Re: oraperl ==> perl5 + DBI + DBD
Message-Id: <Ez2u32.DL2@ig.co.uk>

In article <6qnbpf$gl8$1@morse.news.easynet.net>,
Dan Hopkins <dan@ukonline.net> wrote:
>We've recently been moving a bunch of oraperl scripts over to a AIX 4.1.3
>box blessed with Perl 5.004. Most of the scripts have been happily converted
>to Perl 5 using the DBI (v0.93) and DBD::Oracle v0.46 module to emulate
>oraperl.
>
>Unfortunately, most (if not all) of the calls to ora_bind() seem to fall
>over for no apparent reason. Replacing ora_open() and ora_bind() pairs with
>ora_do() 's seems to work quite happily.
>
>Just wondered if anyone else had come across this problem (with a solution
>:-)

DBD::Oracle 0.46 is quite old now?

Also have you read the readme files - they have hints for various platforms.

We have AIX 4.1.3 in house (but no oracle for it:-( ) so I am afraid
I cannot replicate your problem...

Anyway here is some basic advice to get you started...

1) enable DBI_DEBUG

   ksh% export DBI_DEBUG=2

	or

   my $dbh = ora_login(....);

   $dbh->debug(2); # enable debugging.

2) I know that there was a problem with long binds with Oraperl.pm
   vs DBD::Oracle and Tim fixed this (perhaps after .46).


3) talk to other dbi users...
   read http://www.arcarna.com/technologia/DBI/
   contact the dbi-users list ( at fugue.com I think)

As a final resort, purchase perlclinic support and your problem will
more than likely handled by Tim Bunce (Mr DBI/DBD:Oracle/Oraperl)
himself.

Jacqui

-- 
Email: Jacqui.Caren@ig.co.uk  http://www.ig.co.uk/
Fax  : +44 1483 419 419       http://www.perlclinic.com/
Phone: +44 1483 424 424       http://www.perl.co.uk/
Paul Ingram Group Ltd,140A High Street,Godalming GU7 1AB United Kingdom



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

Date: 10 Sep 1998 16:57:45 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Passing file handles
Message-Id: <6t90e9$4cq$1@pegasus.csx.cam.ac.uk>

cs - Elton Kong <cselton@hkp.hk> wrote:
>Hi!
>
>I would like to know how I can pass a file handle to a sub-routine.
>I'm played with different syntax combinations to no success. Could
>anyone help? Thanks!

Hmm.. let's see:

perldoc -q filehandle

=head1 Found in /home/mjtg/perl5.005_02-TRIAL2/lib/pod/perlfaq5.pod

  [snip irrelevant stuff]

=head2 How can I make a filehandle local to a subroutine?  How do I pass filehandles between subroutines?  How do I make an array of filehandles?

The fastest, simplest, and most direct way is to localize the typeglob
of the filehandle in question:
    [ etc ]



Mike Guy


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

Date: Thu, 10 Sep 1998 17:10:26 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <6KTJ1.677$E9.2396871@ptah.visi.com>

In comp.lang.java.programmer David Cantrell <NukeEmUp@ThePentagon.com> wrote:
: On Thu, 10 Sep 1998 16:35:21 GMT,
:   George Reese <borg@imaginary.com> enlightened us thusly:

:>In comp.lang.java.programmer Sean McAfee <mcafee@waits.facilities.med.umich.edu> wrote:
:>: In article <pFRJ1.634$E9.2309187@ptah.visi.com>,
:>: George Reese  <borg@imaginary.com> wrote:
:>:>In comp.lang.java.programmer John Porter <jdporter@min.net> wrote:
:>:>: George Reese wrote:
:>:>:> Anything that can be done in Perl can by done in Python more easily.
:>
:>:>My claim is so sweeping, all you need to do is come up with a single
:>:>situation in which Perl accomplishes a task easier.
:>
:>: Trivially accomplished.
:>:
:>: [snip]
:>
:>Perl can do things in fewer keystrokes than probably any other
:>language on Earth.  That is exactly its problem.  People actually use
:>that feature!  Now, while both of the above are about as readable as
:>doign the task in question can get, in most cases Perl shortcuts are
:>just an inch away from line noise.

: However, your assertion has been proven wrong.  And _why_ is being
: concise a problem?  If you actually look at production perl code, it
: doesn't appear anything like Obfuscated Perl Contest winners.

Your thesis resist on the premise that fewer keystrokes is better.
That is false.

And you are right.  Production perl code does not look anything like
obfuscated perl.  And a beautiful troll looks nothing like an ugly
troll--but they are still both trolls.

-- 
George Reese (borg@imaginary.com)       http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
   "Keep Ted Turner and his goddamned Crayolas away from my movie."
			    -Orson Welles


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

Date: Thu, 10 Sep 1998 16:47:47 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <35F802B3.7A1F1EC9@inlink.com>

George Reese wrote:
> 
> In comp.lang.java.programmer David Cantrell <NukeEmUp@ThePentagon.com> wrote:
> :   George Reese <borg@imaginary.com> enlightened us thusly:
> 
> :>Perl has no real use.  If you have to do scripting or text processing,
> :>use Python.  Otherwise, use Java.
> 
> : Care to back that up?
> 
> Well, simple:
> 
> Anything that can be done in Perl can by done in Python more easily.
> And you can actually read and maintain the Python code.

I cannot believe the ignorance on display here!

This is just like an assembler programmer saying "anything that can be
done in C can be done in assembler easier, and you can actually read and
maintain the code."

If you like Python great, I'm happy for you.  It surely doesn't make it
the end-all do-all language for everyone.  So, instead of trolling the
newsgroup, just accept the fact that some people LOVE to program in Perl
and others LOVE to program in Python and others LOVE to program in
Q-BASIC, etc, etc....


P.S.  My mom can beat up your mom ;-)
-- 
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$            Brent Michalski             $
$         -- Perl Evangelist --          $
$    E-Mail: perlguy@technologist.com    $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$


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

Date: Thu, 10 Sep 1998 11:27:30 -0500
From: Nathan Bell <nbell@acad.stedwards.edu>
Subject: QUESTION: Perl 5 for Win32
Message-Id: <35F7FDF2.24278A5B@acad.stedwards.edu>

How do I force the output buffer to write to a file without using
close(FILEHANDLE)?

How do I call a function, wait a specified time for it to return, and if
it does not return kill it?  I want to be able to do something similar
to fork() in Unix. You can't do this under Win32 as far as I know. Can
you?  What I want to have happen is I have a section of code that
queries remote machines.  Sometimes that section never returns and I am
forced to kill my script. I want to wait about 2 minutes for it to
return and if it doesn't I want to kill it. (but if it does return I
need to know if it was successful).

Thanks,

Nathan Bell
nbell@acad.stedwards.edu



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

Date: Thu, 10 Sep 1998 16:56:37 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Realtime Parsing Syslog for ftp logins
Message-Id: <35F80268.F1965CB7@bbnplanet.com>

> `man ftpaccess` says it allows for unique logging of classes only (ie
> real anonymous etc) which is no good to me as we have a dozen or so
> "real" users and I only need alerts for one. What I really need is a
> realtime log parser which will take the process id of the ftp login from
> syslog, follow the entries and then cut them out and mail them.

     log commands <typelist>
          Enables  logging  of  individual  commands  by   users.
          <typelist> is a comma-separated list of any of the key-
          words "anonymous", "guest" and "real".  If  the  "real"
          keyword  is  included,  logging  will be done for users
          using  FTP  to  access  real  accounts,  and   if   the
          "anonymous"  keyword  is included logging will done for
          users using anonymous FTP.  The "guest" keyword matches
          guest access accounts (see "guestgroup" for more infor-
          mation).

     log transfers <typelist> <directions>
          Enables logging of file transfers for  either  real  or
          anonymous  FTP  users.   Logging  of  transfers  TO the
          server  (incoming)  can  be  enabled  separately   from
          transfers  FROM the server (outbound).  <typelist> is a
          comma-separated   list   of   any   of   the   keywords
          "anonymous", "guest" and "real".  If the "real" keyword
          is included, logging will be done for users  using  FTP
          to access real accounts, and if the "anonymous" keyword
          is included logging will done for users using anonymous
          FTP.  The "guest" keyword matches guest access accounts
	  ....	

You didn't read far enough. You can log anything with wuftpd just about.
There should be an example of just this in the source. Of course, I
don't really know what _exactly_ you are trying to do here, but I
gathered you wanted to track users and this is one way to do it. Enjoy.

e.


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

Date: Thu, 10 Sep 1998 17:04:01 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Realtime Parsing Syslog for ftp logins
Message-Id: <35F80424.84B529A0@bbnplanet.com>

> > `man ftpaccess` says it allows for unique logging of classes only (ie
> > real anonymous etc) which is no good to me as we have a dozen or so
> > "real" users and I only need alerts for one. What I really need is a
> > realtime log parser which will take the process id of the ftp login from
> > syslog, follow the entries and then cut them out and mail them.

D'oh. Got caught not reading myself. So, what you are doing is tracking
a particular user via ftp only? One way to do it would be to use
wrappers to track all the ftp logins in syslog. Then set-up this user in
his own particular ftp class (yes, you can do this) and set it to log
everything for him/her. Once you have the logging down, it should be
trivial to write a little perl script that you can launch from cron that
will parse these files and mail you with the info you are looking for. 

e.


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

Date: Thu, 10 Sep 1998 17:07:59 GMT
From: Jean-Francois Doyon <root@kam.xvi.com>
Subject: Re: Realtime Parsing Syslog for ftp logins
Message-Id: <Pine.LNX.3.96.980910130544.4014A-100000@kam.xvi.com>



On Thu, 10 Sep 1998, Paraic O Ceallaigh wrote:

> `man ftpaccess` says it allows for unique logging of classes only (ie
> real anonymous etc) which is no good to me as we have a dozen or so
> "real" users and I only need alerts for one. What I really need is a
> realtime log parser which will take the process id of the ftp login from
> syslog, follow the entries and then cut them out and mail them.

Couldn't you do this with a mix of "tail -f", "grep" and "mail" ?

J.F.



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

Date: Thu, 10 Sep 1998 18:14:01 +0100
From: Paraic O Ceallaigh <poc@quay.ie>
To: Jean-Francois Doyon <root@kam.xvi.com>
Subject: Re: Realtime Parsing Syslog for ftp logins
Message-Id: <35F808D9.8660E62F@quay.ie>

> > "real" users and I only need alerts for one. What I really need is a
> > realtime log parser which will take the process id of the ftp login from
> > syslog, follow the entries and then cut them out and mail them.
> 
> Couldn't you do this with a mix of "tail -f", "grep" and "mail" ?
Nope, since mail will not work in this instance until you have quit the
tail -f. Also I want to get more than just an alert - it would be nice
to extract the transfer data as well and include that in the mail.


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

Date: 09 Sep 1998 15:39:23 -0400
From: Ala Qumsieh <aqumsieh@tigre.matrox.com>
Subject: Re: sprintf error in Perlis and PerlScript
Message-Id: <x3yg1e15b4k.fsf@tigre.matrox.com>


David@iqtexas.com writes:

> 
> When ever I use sprintf in Perlis or ASP(PerlScript), errors are returned.

What are the errors? can you give us some hints?

> When the line is commented out, the program runs smoothly.
> When the line is not commented and I use Perl.exe, the program runs smoothly.
> 

Strange!

> ...
> y=1034.5635;
> x=sprintf("%.1f",y);
> ...

hmmm.. I have never programmed Perl on the winblows platform (thank
God) but I know my Perl well enough to swear that Perl scalars are
ALWAYS prefixed by a '$' sign. If this is not the case on winblows,
then I suggest you install Linux!

> 
> Is anyone having this problem?  I have the most recent version of ActivePerl.
> 
> I'm using a work around but it's clumsy, slow and crazy.(Note data is always
> +)
> 
> if (y =~ m/^(\d+\.\d)\d*$/) {
>      x=$1;
> } elsif (y =~ m/^(\d+)$/) {
>      x=$1.'.0';
> }
> 

(I put on my seriously confused face :-\ )
Are you telling me that the above code actually parses and compiles
with no violations?! or is this only pseudocode (I hope)? 

> yuk!

I don't mind you saying that again! yuk!

> 
> Thanks for any help,
> David
> 

Wait a minute .. do your errors resemble the following:

Unquoted string "x" may clash with future reserved word at - line x.

?? If so, then start by reading the Llama book.

If there is something that I don't get, then please excuse my
ignorance and enlighten me furhter.

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


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

Date: Thu, 10 Sep 1998 19:27:01 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: System call in PERL
Message-Id: <35F88A75.374E@comenius.ms.mff.cuni.cz>

Andrew M. Langmead wrote:
> 
> "Jules" <julius@clara.net> writes:
> 
> >Dear all, how do I make a system call in PERL?
> 
> It depends on what you mean by a system call. The traditional meaning
> of "system call" is the method of asking the kernel to perform some
> sort of service. In C, there are usually function call wrappers around
> system calls with names like open(), read() write(), fork(), exec(),
> etc. In perl, the functions that call the corresponding C functions
> usually have the same name, unless the name is already taken for
> something else. Often if the perl function does not correspond to the
> C function, the letters "sys" prepended. So the system call that
> corresponds to C's write() is called syswrite(). Calls to any
> arbitrary system call can be done through the syscall() function, as
> documented in the perlfunc man page, but I feel that you might be
> better off creating an XS module for any system call that perl doesn't
> have a direct equivilent.
> 
> --
> Andrew Langmead

Well said. :-)

And if you happen to work on a Win32 system, you may use Win32::API
to issue the system calls or calls to any function in any DLL you like.

See http://www.divinf.it/dada/perl

Jenda


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

Date: Thu, 10 Sep 1998 17:30:29 GMT
From: Jacqui.Caren@ig.co.uk (Jacqui Caren) (Jacqui Caren)
Subject: Re: Which database to use with Perl for Win32
Message-Id: <Ez2wMu.Dvt@ig.co.uk>

In article <35DA52FE.5BC53EED@cs.pdx.edu>,
Sergio Antoy  <antoy@cs.pdx.edu> wrote:
>Sucheta Khot wrote:
>> 
>> Could anybody please advice me on which database should I use and how
>> should I use with Perl for Win32.
>> 
>> Thanks,
>> Sucheta
>
>I have been using MSAccess.  Look for DBI and DBD::ODBC at
>http://www.hermetica.com/technologia/DBI/index.html.


or use DBD::Oracle and Oracle for NT

or use DBD::Sybase and SQLserver

or use ....


p.s. it is worth mentioning that DBD::ODBC and Win32::ODBC are
very different animals...


>Sergio

Jacqui

-- 
Email: Jacqui.Caren@ig.co.uk  http://www.ig.co.uk/
Fax  : +44 1483 419 419       http://www.perlclinic.com/
Phone: +44 1483 424 424       http://www.perl.co.uk/
Paul Ingram Group Ltd,140A High Street,Godalming GU7 1AB United Kingdom



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

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

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