[17147] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4559 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 9 09:05:27 2000

Date: Mon, 9 Oct 2000 06:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <971096712-v9-i4559@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 9 Oct 2000     Volume: 9 Number: 4559

Today's topics:
    Re: Bug? (Denis Joiret)
    Re: CGI: How to save upload file by perl? i0519@my-deja.com
    Re: Comparing Perl and Java <bmb@ginger.libs.uga.edu>
    Re: emacs written in perl? (Martien Verbruggen)
    Re: error in mapping array slice <krahnj@acm.org>
        error: glob failed (Hans Scholte)
    Re: error: glob failed (Clay Irving)
    Re: error: glob failed (Hans Scholte)
    Re: error: glob failed (Clay Irving)
        Find substring within two markers with regular expressi <gy@fyuo.fjd>
    Re: Find substring within two markers with regular expr (Rafael Garcia-Suarez)
    Re: Find substring within two markers with regular expr <krahnj@acm.org>
    Re: Find substring within two markers with regular expr <gy@fyuo.fjd>
    Re: generating random number w/ specified bit size <sb@muccpu1.muc.sdm.de>
    Re: How do I show html source as plain text in IE brows <radevenz@ix.netcom.com>
    Re: How do I show html source as plain text in IE brows <flavell@mail.cern.ch>
    Re: integer length limitation (Anno Siegel)
        Looking for printer Managment sorce/module <DaveTuring@spam.co.uk>
    Re: Not Entirely On Topic:  Programming and math <mauldin@netstorm.net>
    Re: Number of matches <bugfixxer@yahoo.com>
    Re: Numeric processing problem. <bart.lateur@skynet.be>
    Re: Perl and Outlook <guenther.degenfelder@datev.de>
    Re: Perl and Outlook <sigvald.refsum@siemens.no>
    Re: Perl Books! <ymeydotcom@hotmail.com>
    Re: Perl compiler vivek@cse.iitd.ernet.in
    Re: Perl compiler (Martien Verbruggen)
    Re: Perl compiler (Martien Verbruggen)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 9 Oct 2000 08:54:27 GMT
From: joiret@crow.inria.fr (Denis Joiret)
Subject: Re: Bug?
Message-Id: <8rs143$ces$1@ites.inria.fr>

In article <sznD5.6015$O5.127873@news.itd.umich.edu>, mcafee@waits.facilities.med.umich.edu (Sean McAfee) writes:
|> In article <8rku32$eu3$1@ites.inria.fr>,
|> Denis Joiret <joiret@crow.inria.fr> wrote:
|> >I think I discovered a bug in recent versions of perl5.
|> 
|> >@x = ("One", "Y" =~ /X/, "Two");
|> ># @x should contain ("One", "", "Two"), but actually contains ("One", "Two")
|>  
|> This isn't a bug; the matching operator behaves differently in list
|> context.  From perlop (emphasis added):
|>  
|>    If the /g option is not used, m// in a list context
|>    returns a list consisting of the subexpressions
|>    matched by the parentheses in the pattern, i.e.,
|>    ($1, $2, $3...).  (Note that here $1 etc. are also
|>    set, and that this differs from Perl 4's behavior.)
|>    When there are no parentheses in the pattern, the
|>    return value is the list (1) for success.  With or
|>    without parentheses, an empty list is returned upon
|>    failure.             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|>    ^^^^^^^

You're absolutelly right, I should have looked at the manual before posting.
Actually, I was faced with the problem when I updated my version of Perl. One
of my scripts did not work any more, so I thought it was a bug. Now, I can see
that the bug was in release 5.003, which faultly evaluated the m// operator in a
scalar context inside a list, and this is why my script used to work.


|> >One solution to make things work is to add 0 to the boolean expression as in:
|> >@x = ("One", ("X" =~ /Y/)+0, "Two");
|> 
|> This works because the match is now in scalar context.  It would probably
|> be clearer to use the scalar function:
|> 
|> @x = ("One", scalar "X" =~ /Y/, "Two");

Anyhow, I do think that returning a single element list containing the boolean
value of the m// operator, when the // doesn't contain any () to extract
substrings, whouldn't be a bad idea. I that precise case, when writing :
   (..., m/.../, ...)
one most probably means :
   (..., scalar m/.../, ...)

This is just MY opinion.

|> 
|> -- 
|> Sean McAfee                                                mcafee@umich.edu
|> print eval eval eval eval eval eval eval eval eval eval eval eval eval eval
|> q!q@q#q$q%q^q&q*q-q=q+q|q~q:q? Just Another Perl Hacker ?:~|+=-*&^%$#@!

-- 
                                      Denis Joiret
                                      Administrateur Reseaux INRIA-Rocquencourt

Email: Denis.Joiret@INRIA.Fr
Phone: +33 1 39 63 53 82     Fax: +33 1 39 63 55 96


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

Date: Mon, 09 Oct 2000 11:21:19 GMT
From: i0519@my-deja.com
Subject: Re: CGI: How to save upload file by perl?
Message-Id: <8rs9nc$nig$1@nnrp1.deja.com>

I mean that I have a html file, which have a form to collect local file.
When summited, I want to upload the file. And not by ftp, maybe by
http 's post method, I think.


In article <Pine.LNX.4.21.0010082233530.16008-
100000@hawk.ce.mediaone.net>,
  "Andrew N. McGuire " <anmcguire@ce.mediaone.net> wrote:
> On Mon, 9 Oct 2000, i0519@my-deja.com quoth:
>
> > The file may be binary or ASCII text form.
>
> use ftp? again.
>
> anm
> --
> perl -wMstrict -e '
> $a=[[qw[J u s t]],[qw[A n o t h e r]],[qw[P e r l]],[qw[H a c k e
r]]];$.++
> ;$@=$#$a;$$=[reverse sort map$#$_=>@$a]->[$|];for$](--$...$$){for$}
($|..$@)
> {$$[$]][$}]=$a->[$}][$]]}}$,=$";$\=$/;print map defined()?$_:$,,@$_
for @$;
> '
>
>


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


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

Date: Mon, 9 Oct 2000 06:45:27 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Comparing Perl and Java
Message-Id: <Pine.A41.4.21.0010090644480.9056-100000@ginger.libs.uga.edu>

On Sun, 8 Oct 2000, Jan Schaumann wrote:
> "Brad Baxter" <bmb@ginger.libs.uga.edu> wrote:
> > On Sun, 8 Oct 2000, Jan Schaumann wrote:
> >> Java is an Object-Oriented Full-Featured Programming Language, while
> >> Perl is a Practical Extraction and Report Language.
> > 
> > No, that'd be OOFFPL.  Rhymes with 'awful'.
> 
> I reckon you're the funny guy in this NG?

Not today.

Brad



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

Date: Mon, 9 Oct 2000 19:14:33 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: emacs written in perl?
Message-Id: <slrn8u2vj9.2tj.mgjv@martien.heliotrope.home>

On Sun, 08 Oct 2000 11:56:03 -0500,
	Mike Eggleston <mikeegg@prodigy.net> wrote:
> 
> I suppose what I'd really prefer is a vi written in perl so that I could
> access the underlying interpreter.

What about a vi with embedded Perl? http://www.vim.org/ 

I believe there are other vi clones out there that have Perl embedded
(nvi?), but I don't have experience with any of those.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | I took an IQ test and the results
Commercial Dynamics Pty. Ltd.   | were negative.
NSW, Australia                  | 


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

Date: Mon, 09 Oct 2000 04:06:15 -0700
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: error in mapping array slice
Message-Id: <39E1A6A7.BAEA370B@acm.org>

Tk Soh wrote:
> 
> Ren Maddox wrote:
> >
> > If so, then this should do it (though I certainly don't promise that
> > it is the *best* way):
> >
> > @this_array = ((undef) x 10, @that_array)[-10 .. -1];
> 
> Guess I just found the asnwer:
> 
> @this_array = map {defined $_? $_ : ''}
>                   ((undef) x 10, @that_array)[-10 .. -1];
> 

Why not just:
@this_array = (('') x 10, @that_array)[-10 .. -1];

John


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

Date: Mon, 09 Oct 2000 09:13:30 GMT
From: hans@salience.nl (Hans Scholte)
Subject: error: glob failed
Message-Id: <39e18b78.9611368@news.nl.net>

Hi,

I'm running a perl script on a windows NT and I'm getting the
following error (after running for a long time without any errors):

glob failed <child exited with status 5> at ......... <GEN 0> chunk
 ....

I know this has something to do with the internal program that is used
to perfom the glob but does someone know more specifics about this
error?

tia

Hans


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

Date: 9 Oct 2000 12:08:58 GMT
From: clay@panix.com (Clay Irving)
Subject: Re: error: glob failed
Message-Id: <slrn8u3daq.jk8.clay@panix3.panix.com>

On Mon, 09 Oct 2000 09:13:30 GMT, Hans Scholte <hans@salience.nl> wrote:

>I'm running a perl script on a windows NT and I'm getting the
>following error (after running for a long time without any errors):
>
>glob failed <child exited with status 5> at ......... <GEN 0> chunk
>....
>
>I know this has something to do with the internal program that is used
>to perfom the glob but does someone know more specifics about this
>error?

I'm pretty sure your problem is found at line .........

-- 
Clay Irving <clay@panix.com>
I replaced the headlights in my car with strobe lights, so it looks like I'm
the only one moving.  
- Steven Wright 


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

Date: Mon, 09 Oct 2000 12:24:51 GMT
From: hans@salience.nl (Hans Scholte)
Subject: Re: error: glob failed
Message-Id: <39e1b8a9.21182513@news.nl.net>

On 9 Oct 2000 12:08:58 GMT, clay@panix.com (Clay Irving) wrote:

>On Mon, 09 Oct 2000 09:13:30 GMT, Hans Scholte <hans@salience.nl> wrote:
>
>>I'm running a perl script on a windows NT and I'm getting the
>>following error (after running for a long time without any errors):
>>
>>glob failed <child exited with status 5> at ......... <GEN 0> chunk
>>....
>>
>>I know this has something to do with the internal program that is used
>>to perfom the glob but does someone know more specifics about this
>>error?
>
>I'm pretty sure your problem is found at line .........

Yes, at line ... it says: @files = <JOB*>;

This is correct I think?




>
>-- 
>Clay Irving <clay@panix.com>
>I replaced the headlights in my car with strobe lights, so it looks like I'm
>the only one moving.  
>- Steven Wright 



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

Date: 9 Oct 2000 13:03:56 GMT
From: clay@panix.com (Clay Irving)
Subject: Re: error: glob failed
Message-Id: <slrn8u3ghs.l5p.clay@panix3.panix.com>

On Mon, 09 Oct 2000 12:24:51 GMT, Hans Scholte <hans@salience.nl> wrote:
>On 9 Oct 2000 12:08:58 GMT, clay@panix.com (Clay Irving) wrote:
>>On Mon, 09 Oct 2000 09:13:30 GMT, Hans Scholte <hans@salience.nl> wrote:

>>>I'm running a perl script on a windows NT and I'm getting the
>>>following error (after running for a long time without any errors):
>>>
>>>glob failed <child exited with status 5> at ......... <GEN 0> chunk
>>>....
>>>
>>>I know this has something to do with the internal program that is used
>>>to perfom the glob but does someone know more specifics about this
>>>error?
>>
>>I'm pretty sure your problem is found at line .........
>
>Yes, at line ... it says: @files = <JOB*>;
>
>This is correct I think?

It works fine on a Linux machine:

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

  @files = <JOB*>;
  
  foreach $file(@files) {
      print "$file\n";
  }
  
Result:

  JOB1
  JOB2

-- 
Clay Irving <clay@panix.com>
The world is a very strange place, and the dice are always rolling. 
- Tom Robbins, _Skinny Legs and All_ 


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

Date: Mon, 9 Oct 2000 10:50:29 +0200
From: "Jan van de Pol" <gy@fyuo.fjd>
Subject: Find substring within two markers with regular expression
Message-Id: <8rs0s9$385$1@news.IAEhv.nl>

Hi Everyone,

Is it possible to use $1 again in the pattern of a regular expression? I
mean something like this:

/MARKER_START[\s+]([a-zA-Z0-9_]+)(.*)MARKER_END[\s+]$1/

Clue is that I wish to get all the text between two markers with the same
label.

Thanks in advance

Jan van de Pol




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

Date: Mon, 09 Oct 2000 08:59:54 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Find substring within two markers with regular expression
Message-Id: <slrn8u32la.dju.rgarciasuarez@rafael.kazibao.net>

Jan van de Pol wrote in comp.lang.perl.misc:
>Hi Everyone,
>
>Is it possible to use $1 again in the pattern of a regular expression? I
>mean something like this:
>
>/MARKER_START[\s+]([a-zA-Z0-9_]+)(.*)MARKER_END[\s+]$1/

Yes, with the \1 construct.
 /MARKER_START[\s+]([a-zA-Z0-9_]+)(.*)MARKER_END[\s+]\1/

See the perlre manpage.

-- 
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


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

Date: Mon, 09 Oct 2000 04:20:42 -0700
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Find substring within two markers with regular expression
Message-Id: <39E1AA0A.74E371B6@acm.org>

Jan van de Pol wrote:
> 
> Hi Everyone,
> 
> Is it possible to use $1 again in the pattern of a regular expression? I
> mean something like this:
> 
> /MARKER_START[\s+]([a-zA-Z0-9_]+)(.*)MARKER_END[\s+]$1/
> 
> Clue is that I wish to get all the text between two markers with the same
> label.

[\s+] means either a space character or a '+' character. Are you sure
you didn't mean \s+ for one or more space characters?
[a-zA-Z0-9_] is the same as \w.
$1 should be \1.

Your regex should probably look like more like this.
/MARKER_START[\s+](\w+)(.*)MARKER_END[\s+]\1/

HTH

John


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

Date: Mon, 9 Oct 2000 14:21:53 +0200
From: "Jan van de Pol" <gy@fyuo.fjd>
Subject: Re: Find substring within two markers with regular expression
Message-Id: <8rsd8l$3pr$1@news.IAEhv.nl>

Oke, this was doing almost what I want. The final version looks like this:

/MARKER_START\s+(\w+)\W(.*)MARKER_END\s+\1\W/s

I have added the \W because I wanted the whole word to be repeated and not
just the part that corresponds with the second occurence of the word(part).
The "treat as single line" is added because \n can exist between the
markers.

Thanks for yuor quick response and helped me to solve my problem

"John W. Krahn" <krahnj@acm.org> wrote in message
news:39E1AA0A.74E371B6@acm.org...
> Jan van de Pol wrote:
> >
> > Hi Everyone,
> >
> > Is it possible to use $1 again in the pattern of a regular expression? I
> > mean something like this:
> >
> > /MARKER_START[\s+]([a-zA-Z0-9_]+)(.*)MARKER_END[\s+]$1/
> >
> > Clue is that I wish to get all the text between two markers with the
same
> > label.
>
> [\s+] means either a space character or a '+' character. Are you sure
> you didn't mean \s+ for one or more space characters?
> [a-zA-Z0-9_] is the same as \w.
> $1 should be \1.
>
> Your regex should probably look like more like this.
> /MARKER_START[\s+](\w+)(.*)MARKER_END[\s+]\1/
>
> HTH
>
> John




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

Date: 9 Oct 2000 09:59:42 GMT
From: Steffen Beyer <sb@muccpu1.muc.sdm.de>
Subject: Re: generating random number w/ specified bit size
Message-Id: <8rs4ue$ffs$1@solti3.sdm.de>

In article <8rrm1d$djj$1@news-int.gatech.edu>, Jorg Ziefle <gt4556a@prism.gatech.edu> wrote:

> For a crypto algorithm implementation, I need to generate a "true" random
> number with a pre-specified bit size. E.g., "create a random number whose
> binary representation is $size digits long".

> Here is what I have come up with. Basically, it generates a bit vector by
> iterating $size times and generating a random bit at the corresponding
> position by the following procedure:
> * using Math::TrulyRandom to get a truly_random_value()
> * calculates the cross sum of it
> * if the cross sum is even, the bit is 0, otherwise 1

> Then, the bit vector is transformed in a Math::BigInt value. This is
> necessary cause a reasonable $digits for the algorithm is about 200
> to 400 ;)

> My question is: As the below is horribly slow, does anybody have a better
> idea for the problem and/or can my code be written more elegant/efficient
> (pack/unpack, ...)?

> Any help is greatly appreciated ( before I start pluggin' in the same in C via XS ;) ).

Use Bit::Vector - it's written in C, internally, for speed.

-- 
    Steffen Beyer <sb@engelschall.com>
    http://www.engelschall.com/u/sb/whoami/ (Who am I)
    http://www.engelschall.com/u/sb/gallery/ (Fotos Brasil, USA, ...)
    http://www.engelschall.com/u/sb/download/ (Free Perl and C Software)


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

Date: Mon, 9 Oct 2000 07:21:00 -0400
From: "Richard DeVenezia" <radevenz@ix.netcom.com>
Subject: Re: How do I show html source as plain text in IE browser?
Message-Id: <8rs9ni$oql$1@slb0.atl.mindspring.net>

YMEY:

Thanks for the tip.  I never knew about <PLAINTEXT> since all my
documentation is HTML 4 spec.
Since <PLAINTEXT> was obsoleted in HTML 3.2 I'll probably keep away from it.

<PLAINTEXT> works in IE5 (didn't try Netscape).

The <PRE> tag that is supposed to be used in place of <PLAINTEXT> did not
work for me.
Since the content of the <PRE> contains an <HTML>, IE decided to render the
html instead of displaying the source. Arrgh.

Edmond:

On my system opening an .HTML file that was renamed .HTML.txt opens the file
into my text editor.  Dragging and dropping the HTML.txt file into a browser
window, only shows the text.  Alot probably depends on some undocumented or
deeply unknown setting for an active this or active that.

I revisited trying to do everything as text/plain and came up with this
snippet that works in IE (I assume it works in NS, since NS did the right
thing originally)

  while (<SITEFILE>) {

s/<HTML>/<-HTML tag mangled to prevent IE from thinking you want this
text\/plain rendered as HTML>/i ;

   print "$_";
  }
  close SITEFILE;


Note, the mangling is the dash (-) before HTML.  If I had <HTML-hey
everthing is cool, even though this is wrong>, IE would would still render
the text/plain as html.

--
Richard DeVenezia

"YMEY" <ymeydotcom@hotmail.com> wrote in message
news:39E0AD2F.3592A2F4@hotmail.com...
> Edmond Nolan wrote:
> >
> > Hi Richard,
> >
> > I don't have an answer, just thought I grumble along with you! I've seen
> > this kinda behaviour before with MSIE 5, even opening a text file (.txt)
> > locally which contains HTML code is read as a HTML file :(
> >
> > Richard DeVenezia wrote:
> >
> > > I am trying to write a simple 'push' perl program to deliver example
parts
> > > of my web as plain text.
> > >
> > > The problem is when I try to deliver an html file, it gets interpreted
as
> > > html and is rendered by the IE browser.
> > > Netscape 4.7 simply shows the text, IE is too smart for it's britches.
Is
> > > there some way to make IE honor the content-type ?
> > >
> > > snippet
> > >
> > > # invoked as <server>/cgi-bin/push?file=<some file name>&type=txt
> > > # & type=txt is to hopefully fool some browsers to really deal with
the
> > > content as text
> > >
> > > use CGI;
> > > my $q = new CGI;
> > > my $file = $q->param('file');
> > >
> > > if ( <... file exists and file is allowed to be pushed ...>) {
> > >     print $q->header('text/plain');
> > >     print "###### $file #######\n";
> > >
> > >     system ("cat $file");
> > > }
> > >
> > > --
> > > Richard DeVenezia
>
> Try sending a plaintext tag, and then cat $file :)
>
> ##
>
> print "Content-type: text/html\n\n";
> print <<OEM;
> <HTML>
> <HEAD><TITLE>$file</TITLE></HEAD>
> <BODY>
> <PLAINTEXT>\n #This turns everything after it into plain text :)
> OEM
>
> system("cat $file");
>
> print "</PLAINTEXT></HTML>\n";




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

Date: Mon, 9 Oct 2000 14:14:04 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: How do I show html source as plain text in IE browser?
Message-Id: <Pine.GHP.4.21.0010091402090.12230-100000@hpplus03.cern.ch>

On Mon, 9 Oct 2000, Richard DeVenezia wrote:

> Thanks for the tip.  I never knew about <PLAINTEXT> 

It was already obsolete in RFC1866/HTML2.0.  You're relying on a
dinosaur if you decide to rely on that.  It would be a potential
security exposure[1].

> Since <PLAINTEXT> was obsoleted in HTML 3.2 I'll probably keep away from it.

Very sensible.

> The <PRE> tag that is supposed to be used in place of <PLAINTEXT> did not
> work for me.

Of course it "works" as designed.  You have to entify the markup which
it contains.

If you want to discuss how to cope with a broken web browser (which is
what the original question is about), the Perl langage group is the
wrong venue.  I recommend comp.infosystems.www.browsers.ms-windows


[excessive joepardy-style quotage deleted.  I'd advise you to get a
grasp of a usenet new users tutorial, or you'll be going into people's
killfiles.]

[1] CERT alert CA-2000-02 discusses ways in which active content can
be smuggled into apparently harmless HTML if the rules of entification
are not properly observed.



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

Date: 9 Oct 2000 10:30:05 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: integer length limitation
Message-Id: <8rs6nd$j7e$1@lublin.zrz.tu-berlin.de>

Logan Shaw <logan@cs.utexas.edu> wrote in comp.lang.perl.misc:
>In article <39de57cb$0$25501@news.denver1.Level3.net>,
>Greg Lindsay <greg.lindsay@level3.com> wrote:
>>I'm trying to execute a modulus on a number, but keep coming up with the
>>wrong answer.  The only thing I can think of is that the number is being
>>truncated because it's too big.  How do I tell perl to keep the entire
>>number instead of expressing it as 3.37587917446654e+35?
>
>Perl is using your system's built-in floating point type.  Floating
>point types store numbers as a mantissa and an exponent, with a fixed
>precision for each one.  They do this so you can store large numbers
>without needing to use more than a fixed number of bits (32 or 64,
>usually).
>
>What you want is some sort of "bignum" package, i.e. a way to make Perl
>know how to deal with numbers that have arbitrarily large precision.  I

It's probably advisable to use arbitrary precision with a problem
like this.  However, if the modulus is small enough (its square fitting
into an integer), the desired result can be obtained with native integer
arithmetic, and quite efficient at that.

  sub expmod {
    use integer;
    my ( $x, $e, $m) = @_;
    my $res = 1;
    while ( $e ) {
      if ( $e % 2 ) {
        $res *= $x;
        $res %= $m;
      }
      $x *= $x;
      $x %= $m;
      $e /= 2;
    }
    return $res;
  }

This calculates $x**$e % $m in time proportional to log $e.  The same
algorithm would be used with arbitrary precision arithmetic to keep
the intermediate results manageable.

Anno


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

Date: Mon, 9 Oct 2000 09:40:43 +0100
From: "Dave Turing" <DaveTuring@spam.co.uk>
Subject: Looking for printer Managment sorce/module
Message-Id: <8rs0br$vn$1@supernews.com>

Trying to write a single terminal "DEMO" multi user printer management
programme in perl.

Help would be appreciated in locating any printer management source /
modules as new to subject.
Should exploit the use of pipes, file checking etc..

Any help (links-source etc) to achieve this would be appreciated, thanks.

Regards
Dave

Reply to : Perl@digital-spy.co.uk









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

Date: Mon, 09 Oct 2000 10:49:08 GMT
From: Jim Mauldin <mauldin@netstorm.net>
Subject: Re: Not Entirely On Topic:  Programming and math
Message-Id: <39E1A257.AAD01401@netstorm.net>

Logan Shaw wrote:
> 
> In article <35eptscl81drjr8gn9teh5ol2a2p00gcql@4ax.com>,
> Lou Moran  <lmoran@wtsg.com> wrote:
> >--Is a strong background in mathematics (not arithmetics) mandatory
> >for a successful career as a programmer?
> 
> Well, you can probably have a successful career without it,
> but having a good math background can help you understand
> other things which can be helpful in programming.
> 
> For instance, how long does this code take?
> 
>         for ($x = 100; $x < 200; $x++)
>                 { sleep $x; }
> 
> If you know some simple calculus, you can glance at that and realize
> that a decent approximation to the answer is the definite integral of
> x dx from x = 100 to x = 199, so about 1/2 * (199^2 - 100^2) or
> about 14800 seconds.  That might be off by a hundred or two, but
> it's probably within 1%.
> 

No need for calculus.  Average is about 150 secs and there are about 100
so that makes about 15000.

--Jim


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

Date: Mon, 9 Oct 2000 11:13:46 +0400
From: "Andrew Tkachenko" <bugfixxer@yahoo.com>
Subject: Re: Number of matches
Message-Id: <8rrrb2$6lt$1@arcom.rcom.spb.su>

IMHO, if you have a list of TLD's, do you really need to build some
regexp's? May be better use something like this?
    for (split (' ', $TLDS)) {$hash {$_}++};

Collin Borrlewyn <collin@crosslink.net> пишет в
сообщении:971063245.847539@pizza.crosslink.net...
> What I'm trying to do is determine how many times a particlar pattern was
> matched in a scalar. Specifically, I'm scanning the ICANNs list of
proposed
> TLDs and trying to return what the most suggested TLDs are, and how many
> times each was suggested. For my own amusement, like. So... how can I get
a
> regexp to tell me how many matches were found? I've looked at every bit of
> documentation I can think of, but nothing seems to mention it. This was
> going to be something I did in a few minutes for fun, but it didn't work,
I
> grew curious, and now I really want to know.
>
>
> #Collin E Borrlewyn
> ##More enlightening than Buddist Jeopardy.
> ###collin@crosslink.net
>
>




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

Date: Mon, 09 Oct 2000 07:42:04 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Numeric processing problem.
Message-Id: <7mt2us85q1m7bc23mih38uv7dnbe4211mi@4ax.com>

Jon DeCamp wrote:

> All I can offer further are more 11/6 digit pairs, because I have
>plenty.

Do you have *all* of them? Because, then, all you need is a lookup
table.

-- 
	Bart.


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

Date: Mon, 9 Oct 2000 11:17:59 +0200
From: "Guenther Degenfelder" <guenther.degenfelder@datev.de>
Subject: Re: Perl and Outlook
Message-Id: <39e18e2a@news.datev.de>


"Bob Walton" <bwalton@rochester.rr.com> schrieb im Newsbeitrag
news:39E122CF.3CD297B@rochester.rr.com...
> vivi16@my-deja.com wrote:
> >
> > In a Perl file I want to send the results of a form to the user via E-
> > mail.  Is it possible to use MS Outlook as the mail program?  And does
 ...
> ...
> I don't know much about Outlook, but my impression is that it is a mail
> client program, not a mail server.  If so, you would be a lot better off
 ...
>    use Net::SMTP;

Sending via Outlook you should use MAPI. Sending with SMTP only works, if
you are running a SMTP-Gateway on your Exchange-Server (probably you
don't!).
There are little tools to do this on the command-line.
Ask me, fi you can't find one...

Regards

Guenther




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

Date: Mon, 09 Oct 2000 13:22:47 +0200
From: Sigvald Refsum <sigvald.refsum@siemens.no>
To: vivi16@my-deja.com
Subject: Re: Perl and Outlook
Message-Id: <39E1AA87.86AC682F@siemens.no>

This is a multi-part message in MIME format.
--------------87FA89849BA7C8461994FE8E
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

This may solve half your problem, as it sends a mail using outlook,
the second half I simply don't know. The server we use at Siemens
is an Exchange server, and I havent a clue to how it is accessed.

    Best regards.
    Sigvald

PS
The attached sample code is ment as an example and the code style
is perhaps not optimal.
DS

vivi16@my-deja.com wrote:

> In a Perl file I want to send the results of a form to the user via E-
> mail.  Is it possible to use MS Outlook as the mail program?  And does
> the program have to reside on the server where the Perl program is?
>
> I recall reading in this discussion group (though can't find it now)
> someone saying that this might be possible (using Outlook and not
> having it reside on the local server).
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

--------------87FA89849BA7C8461994FE8E
Content-Type: application/x-perl;
 name="outlookSend.pl"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline;
 filename="outlookSend.pl"

use Win32::OLE qw(in with);

my $OutLook = Win32::OLE->new('Outlook.Application.8')       
   or die "Couldn't connect to Outlook";

my $NewMail;
# Create Mail object
$NewMail = $OutLook->CreateItem(0);

# Address Mail Object, can be repeated for several recipients
$NewMail->Recipients->Add('sigvald');

# CC Address Mail Object, can be repeated for several recipients
$NewMail->Recipients->Add('sigvald');
$NewMail->Recipients->Item('sigvald')->{Type} = 2;

# Resolve addresses
$NewMail->Recipients->ResolveAll();

# Categories string
$NewMail->{Categories} ="PVCS operation";

# Voting option string
$NewMail->{VotingOptions} ="Pizza;Salat;China";

# Originator Delivery Report Requested
$NewMail->{OriginatorDeliveryReportRequested} = 1;

# Subject string
$NewMail->{Subject} ="hei";

# Body
$NewMail->{Body} = "kЕre heisan\n";

#Attachments
$NewMail->Attachments->Add('H:\C_wrk\parser\outlookSend.pl');

# Print
# $NewMail->PrintOut();

# Reminder
my $hour   = (16 * 3600)*(1/86400);
my $minute = (20 * 60)*(1/86400);

$NewMail->{FlagDueBy} = 36538+$hour+$minute;
$NewMail->{FlagRequest} = 'Review Tue 13.01.00 16:20';


# Away it goes
$NewMail->Send;

# Quit
$OutLook->Close();


--------------87FA89849BA7C8461994FE8E--



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

Date: Mon, 09 Oct 2000 07:37:25 -0400
From: YMEY <ymeydotcom@hotmail.com>
Subject: Re: Perl Books!
Message-Id: <39E1ADF5.CB57BD5E@hotmail.com>

Ilya Zakharevich wrote:
> 
> [A complimentary Cc of this posting was sent to Elaine Ashton
> <elaine@chaos.wustl.edu>],
> who wrote in article <B606A47F.7A8C%elaine@chaos.wustl.edu>:
> > Yes, scanning in text from a book without permission from the publisher is
> > theft. In the first few pages of any book is the copyright page that usually
> > includes such text as 'may not be reproduced without the consent of the
> > publisher'.
> 
> C'mon, and a lot of software packages are marked as "if you open this,
> you agree to ...".  Whatever the publisher puts after the title page
> is not binding.
> 
> You know quite well that in a lot of situations "scanning in text from
> a book without permission from the publisher" it not only legal, it is
> moral too.
> 
> BTW, I do not know, is putting "Far side" cartoons in the *out side*
> of the door of your office a copyright infringement?  It is not that
> far from putting it on Internet...
> 
> Ilya

Isn't that the truth (DOH! All them dilberts all over the place :)

I posted those books for educational purposes... As the *LAW states. It
is only piracy when and if I were to take a copy and try to *SELL it.
(i.e. make money) Unlike the rest of the money mongers here, the dollar
doesn't mean ditly to me, compared to an education....

Now if these wanna-B's would take that silver spoon out there arse and
buy the books for me, then maybe they wouldn't have to worry about their
misconception towards the word piracy.

Ohwell. peece peeps... No need for this group... "Got Books" :p


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

Date: Mon, 09 Oct 2000 10:11:55 GMT
From: vivek@cse.iitd.ernet.in
Subject: Re: Perl compiler
Message-Id: <8rs5l9$kqf$1@nnrp1.deja.com>

i have tried perl.com and cpan.org
but they have got interpretors for perl
but i am looking for a compile which can change my source code into a
binary


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


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

Date: Mon, 9 Oct 2000 21:53:27 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Perl compiler
Message-Id: <slrn8u38t6.2tj.mgjv@martien.heliotrope.home>

On Mon, 09 Oct 2000 10:11:55 GMT,
	vivek@cse.iitd.ernet.in <vivek@cse.iitd.ernet.in> wrote:
> i have tried perl.com and cpan.org
> but they have got interpretors for perl
> but i am looking for a compile which can change my source code into a
> binary

That's because, at this moment in time, there is no perl that compiles
your program to native bytecode. Perl is an interpreted language[1].
Find a copy of the documentation of perl (use the sites above). Find the
FAQ. Find section 3. Find the question that says: "How can I compile my
Perl program into byte code or C?"

Do some work yourself. Look around the documentation

Martien

[1] This is not strictly true, only marginally, and sloppily. While perl
does read your source file each time it needs to execute it, it does
compile it, and execute the compiled version. it just doesn't compile to
native machine code. Also, while perl acts in this way, there is nothing
that makes Perl _inherently_ an interpreted language.
-- 
Martien Verbruggen              | 
Interactive Media Division      | Useful Statistic: 75% of the people
Commercial Dynamics Pty. Ltd.   | make up 3/4 of the population.
NSW, Australia                  | 


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

Date: Mon, 9 Oct 2000 21:56:42 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Perl compiler
Message-Id: <slrn8u393a.2tj.mgjv@martien.heliotrope.home>

On Mon, 9 Oct 2000 21:53:27 +1100,
	Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
> Find a copy of the documentation of perl (use the sites above). Find the
                                      ^^^^
                                      Perl
Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Hi, Dave here, what's the root
Commercial Dynamics Pty. Ltd.   | password?
NSW, Australia                  | 


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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

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

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


------------------------------
End of Perl-Users Digest V9 Issue 4559
**************************************


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