[17537] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4957 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 23 21:05:39 2000

Date: Thu, 23 Nov 2000 18:05:12 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <975031512-v9-i4957@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 23 Nov 2000     Volume: 9 Number: 4957

Today's topics:
        Accessing Microsoft SQL felrodian@my-deja.com
        Can regexps handle this type of parsing? <dross@iders.ca>
    Re: Can regexps handle this type of parsing? (Tad McClellan)
    Re: Can regexps handle this type of parsing? <bart.lateur@skynet.be>
    Re: Can regexps handle this type of parsing? (Martien Verbruggen)
    Re: Can regexps handle this type of parsing? <dross@iders.ca>
    Re: Can regexps handle this type of parsing? (Tad McClellan)
    Re: Can regexps handle this type of parsing? (Martien Verbruggen)
    Re: Can regexps handle this type of parsing? (Tad McClellan)
    Re: CGI in a table <khote@mminternet.com>
        Checking if file exists (filename contains a wildcard) <ana.dominguez@centurytel.com>
        Checksum help please! <mike@aol.com>
        Creating Excel Spreadsheets from data... <wmcdonald@bclc.com>
    Re: Creating Excel Spreadsheets from data... (Tad McClellan)
        Determining size of image <dan@karran.net>
    Re: Determining size of image (Martien Verbruggen)
    Re: How do you determine the current stack frame depth? (Honza Pazdziora)
    Re: Most easy way to get IP from a local NIC by device  (Ilya Zakharevich)
    Re: Need a fast $150???  Write (or find) me a couple of (Randal L. Schwartz)
    Re: OOP and information hiding <brannon@lnc.usc.edu>
    Re: Perl DBI <vautour@unb.ca>
    Re: perl options (Eric Bohlman)
    Re: perl options (Tad McClellan)
        PERL PROGRAMMER Wanted <mike@All-starZ.com>
    Re: Perl spider performance <brannon@lnc.usc.edu>
        perl2exe, does anybody know this software? <cvinfo@mail.com>
        Print output to a Printer <Barna@MegaPage.ch>
    Re: Print output to a Printer <Petri_member@newsguy.com>
    Re: Problem r/w binary files (Martien Verbruggen)
        Site montior <webmaster@ukdj.freeserve.co.uk>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 24 Nov 2000 00:25:40 GMT
From: felrodian@my-deja.com
Subject: Accessing Microsoft SQL
Message-Id: <8vkci3$3tv$1@nnrp1.deja.com>

What perl mod will work with Microsoft SQL? Due to its popularity, I
know there must be tons. Does DBI work with it? We don't have the server
set up yet to test, they(employers) want me to gather everything I need
first ie perl modules.

Thank you,
felrodian
webmaster@globalpcsystems.com


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


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

Date: Thu, 23 Nov 2000 22:18:25 GMT
From: Derek Ross <dross@iders.ca>
Subject: Can regexps handle this type of parsing?
Message-Id: <3A1D971C.6AFD@iders.ca>

Hello,

I'm trying to automate parsing through some DSP files to extract a list
of variables defined in the files.

The variable keyword in this case is ".global", which by itself would
make parsing quite easy in perl.

The problem is that variables may also be arrays, may be defined more
than one per line, and may have C-style comments between them. The
variable names have the same syntax as C variable names.

I'm not sure if I should dive into this, or if it is even possible with
regexps. Maybe I should quit while I'm ahead?

Here's a pseudo-sample of the code I'm trying to parse through:

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

 .global big_var[1000]; /* a big variable */

 .global my_variable99,
	the_array[123],
	_another_var, yet_another, /* comment */
	the_variable;

 .global little_var[1]; /* a little variable */

/* variables may be defined anywhere in a file */

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

Thanks for any hints,

Derek Ross


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

Date: Thu, 23 Nov 2000 17:41:41 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Can regexps handle this type of parsing?
Message-Id: <slrn91r795.ths.tadmc@magna.metronet.com>

Derek Ross <dross@iders.ca> wrote:

>I'm trying to automate parsing through some DSP files to extract a list
>of variables defined in the files.
>
>The variable keyword in this case is ".global", which by itself would
>make parsing quite easy in perl.
>
>The problem is that variables may also be arrays, 


That is not a problem (unless you don't want to count them, but
you said "count variables" and arrays certainly _are_ variables...)

Any way, I expect that you want to exclude finding array names?

No problem, just use a one character look-ahead.



>may be defined more
>than one per line, 


You don't show any examples of that. Every line has zero or one name on it.

I do see some examples of "more than once per statement" though.

That is not a problem if we are given a way to find the end of
statments to go along with the ".global starts statements" rule.

Can we count on a semicolon (outside of comments) marking the
end of the statement?

If so, then also no problem.

(assuming that slurping the entire file into a scalar 
 is not a problem)


>and may have C-style comments between them. 
              ^^^^^^^^^^^^^^^^

You were one character off from a search term that would
have found a Perl FAQ:

   "How do I use a regular expression to strip C style comments 
    from a file?"

So that also is no problem.


>The
>variable names have the same syntax as C variable names.


Errr, which is the same syntax as Perl variable names, unless
I'm mistaken. 

>I'm not sure if I should dive into this, or if it is even possible with
>regexps. 


Yes, it's possible with pattern matches (note the plural).


>Maybe I should quit while I'm ahead?


Errr, if you must have this done, and you don't know how to do it yet, 
then you are quitting while you're _behind_    heh, heh.


>Thanks for any hints,


How about the whole solution?


----------------------------
#!/usr/bin/perl -w
use strict;

{ local $/;     # set slurp mode
  $_ = <DATA>;  # slurp whole file into memory
}

s{/\*.*?\*/}{}gs;  # use the simple minded way 'cause it's
                   # only a Usenet post  :-)

while ( m/\.global(.*?);/gs ) {                     # for each statement
   my $stmt = $1;
   while ( $stmt =~ m/([a-z_]\w*)/g ) {             # for each identifier
      if ( substr($stmt, pos($stmt), 1) ne '[' ) {  # check the next char
         print "$1\n";
      }
   }
}


__DATA__

 .global big_var[1000]; /* a big variable */

 .global my_variable99,
       the_array[123],
       _another_var, yet_another, /* comment */
       the_variable;

 .global little_var[1]; /* a little variable */

/* variables may be defined anywhere in a file */
----------------------------


-- 
    Tad McClellan                          SGML consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Fri, 24 Nov 2000 00:04:41 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Can regexps handle this type of parsing?
Message-Id: <csbr1t482r01nvrqeuhovqsfs782rb0iji@4ax.com>

Derek Ross wrote:

>I'm trying to automate parsing through some DSP files to extract a list
>of variables defined in the files.
>
>The variable keyword in this case is ".global", which by itself would
>make parsing quite easy in perl.
>
>The problem is that variables may also be arrays, may be defined more
>than one per line, and may have C-style comments between them. The
>variable names have the same syntax as C variable names.
>
>I'm not sure if I should dive into this, or if it is even possible with
>regexps. Maybe I should quit while I'm ahead?

Sure it can be done. Here's some code. Unsolved problems include
multiline comments, and comments containing semicolons. And probably
nontrivial arrays as well.

	while(<DATA>) {
	    if(/^\.global\s+/g .. /;/) {  # those lines...
	        print "Line: $_";
	        while(/\G(?:\s*\/\*.*?\*\/)*/gc, # skip comments
	           /\G\s*([a-zA-Z_]\w*)\s*(\[\d+\])?,?/g) {
	            unless($2) {
	                print "Var: $1\n";
	            } else {
	                print "Array: $1$2\n";
	            }
	        }
	    }
	}
__DATA__

 .global big_var[1000]; /* a big variable */

 .global my_variable99,
	the_array[123],
	_another_var, yet_another, /* comment */ one_more,
	/* more */   /* comment */ the_variable;

/* some code */
for(x=0; x<10; x++) {
	y = 2 * x;
}

 .global little_var[1]; /* a little variable */


-- 
	Bart.


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

Date: Fri, 24 Nov 2000 11:25:24 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Can regexps handle this type of parsing?
Message-Id: <slrn91rdbk.imr.mgjv@martien.heliotrope.home>

On Thu, 23 Nov 2000 22:18:25 GMT,
	Derek Ross <dross@iders.ca> wrote:
> Hello,
> 
> I'm trying to automate parsing through some DSP files to extract a list
> of variables defined in the files.
> 
> The variable keyword in this case is ".global", which by itself would
> make parsing quite easy in perl.
> 
> The problem is that variables may also be arrays, may be defined more
> than one per line, and may have C-style comments between them. The
> variable names have the same syntax as C variable names.
> 
> I'm not sure if I should dive into this, or if it is even possible with
> regexps. Maybe I should quit while I'm ahead?

I wouldn't try to do it with one regex. A state machine is more logical.
Parse::RecDescent would do it, but probably is overkill. If we can
assume that the comments are reasonably simple, and can be matched by a
single regexp (this is not a C source file, so common pitfalls with that
approach do not apply here), the following could do. 

Note that this requires you to read the file in memory. If files get
big, this is a bad idea. It would be better to use a state machine in
that case.

#!/usr/local/bin/perl -wl
use strict;

$/ = undef;
$_ = <DATA>;

# First strip all comments, then all whitespace
s#/\*.*?\*/##gs;
s#\s+##g;

my @vars = ();

# Everything between a .global token and the nearest following semicolon
# is a list of identifiers
while (m#\.global(.*?);#gs)
{
    push @vars, split /,/, $1;
}

print for @vars;

# Do your manipulation of the variables here

__DATA__
 .global big_var[1000]; /* a big variable */

 .global foo /*  ;comment 

 */, bar[100] /*other comment*/
;/*

 .global ThisShouldnotAppear;
*/

 .global fafa; .global bebe;

 .global my_variable99,
        the_array[123],
        _another_var, yet_another, /* comment */
        the_variable;

 .global little_var[1]; /* a little variable */

/* variables may be defined anywhere in a file */

-- 
Martien Verbruggen              | 
Interactive Media Division      | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.   | Gates?
NSW, Australia                  | 


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

Date: Fri, 24 Nov 2000 00:46:44 GMT
From: Derek Ross <dross@iders.ca>
Subject: Re: Can regexps handle this type of parsing?
Message-Id: <3A1DB9E1.850@iders.ca>

Tad McClellan wrote:

> How about the whole solution?
> 
> ----------------------------
> #!/usr/bin/perl -w
> use strict;
> 
> { local $/;     # set slurp mode
>   $_ = <DATA>;  # slurp whole file into memory
> }
> 
> s{/\*.*?\*/}{}gs;  # use the simple minded way 'cause it's
>                    # only a Usenet post  :-)
> 
> while ( m/\.global(.*?);/gs ) {                     # for each statement
>    my $stmt = $1;
>    while ( $stmt =~ m/([a-z_]\w*)/g ) {             # for each identifier
>       if ( substr($stmt, pos($stmt), 1) ne '[' ) {  # check the next char
>          print "$1\n";



Whoah!
How did you do that?


Derek Ross


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

Date: Thu, 23 Nov 2000 18:53:15 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Can regexps handle this type of parsing?
Message-Id: <slrn91rbfb.tpa.tadmc@magna.metronet.com>

Derek Ross <dross@iders.ca> wrote:
>Tad McClellan wrote:
>
>> How about the whole solution?

[ snip code ]

>Whoah!
>How did you do that?


With skill, cunning, and agility, how else?


-- 
    Tad McClellan                          SGML consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Fri, 24 Nov 2000 12:01:05 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Can regexps handle this type of parsing?
Message-Id: <slrn91rfeh.imr.mgjv@martien.heliotrope.home>

On Thu, 23 Nov 2000 17:41:41 -0500,
	Tad McClellan <tadmc@metronet.com> wrote:
> Derek Ross <dross@iders.ca> wrote:
> 
>>I'm trying to automate parsing through some DSP files to extract a list
>>of variables defined in the files.
>
> How about the whole solution?

See... T may be MTOWTDI, but there's only one True Way :)

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | I'm just very selective about what I
Commercial Dynamics Pty. Ltd.   | accept as reality - Calvin
NSW, Australia                  | 


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

Date: Thu, 23 Nov 2000 19:26:14 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Can regexps handle this type of parsing?
Message-Id: <slrn91rdd6.ts3.tadmc@magna.metronet.com>

I, myself <tadmc@metronet.com> wrote:

>   while ( $stmt =~ m/([a-z_]\w*)/g ) {             # for each identifier


I forgot an 'i' option on the end of that one.

(but I can blame it on the poorly-thought-out test data  :-)


-- 
    Tad McClellan                          SGML consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Thu, 23 Nov 2000 17:01:02 -0800
From: "Kevin Hagel" <khote@mminternet.com>
Subject: Re: CGI in a table
Message-Id: <t1rfhi7pib4ncb@corp.supernews.com>

http://stein.cshl.org/WWW/software/CGI/
Has excellent material on how to use CGI object etc. for placement of table
elements within a perl.cgi




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

Date: Thu, 23 Nov 2000 15:09:44 -0600
From: Ana Dominguez <ana.dominguez@centurytel.com>
Subject: Checking if file exists (filename contains a wildcard)
Message-Id: <1FfT5.100$d7.1840@read1.centurytel.net>

Hello,

I have tried to use the -e function to determine if a file exists but my
filename contains *s in its name. The function always returns false. Is
there a different function that can be used? Do I have to use the
directory functions to determine if my file exists after getting the
list of existing files under a directory?

My program is trying to move files from one directory to another. The
script runs on a Unix system and the only way to move the files seems to
be by using a call to the Unix mv command. I read that there is supposed
to be a move function as part of File::Copy module but I could not find
it. The module installed on the system I am using does not have a "move"
function.

Any pointers would be greatly appreciated.
--
Anna




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

Date: Thu, 23 Nov 2000 23:47:07 -0000
From: "Mike" <mike@aol.com>
Subject: Checksum help please!
Message-Id: <975023461.719577@tubarao.ip.pt>

I'm new to perl and I want to create a checksum rotine that verifies if any
changes were made on an external data file.


can anyone help me on this?

Thank you in advance.




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

Date: Thu, 23 Nov 2000 11:42:07 -0800
From: "Willie McDonald" <wmcdonald@bclc.com>
Subject: Creating Excel Spreadsheets from data...
Message-Id: <OreT5.129396$47.2058375@news.bc.tac.net>

I'm trying to customize an Excel spreadsheet that was created from data
grabbed from a text file.

The Perl script has been working for about 7 months and I decided it needed
a facelift and some new additions. One of the additions I want to add is
multiple sheets in a work book, but I need to know how to name any new
sheets (on the little tab attached to each worksheet in a workbook) that are
created.

Here is my code on how I create the spreadsheet (note: I think I found the
guts of this code this on the web about a year ago, I have no idea who wrote
it, but thanks!) :

<SNIPPET>
use OLE;
$application = CreateObject OLE 'Excel.Application' || die $!;

$application->{'Visible'} = 1;
$workbook = $application->Workbooks->Add();
$worksheet = $workbook->Worksheets(1);
$worksheet->Range("A1")->{'Value'} = $currentMonth . " BCLC Cell Phone
Billing Summary";
$worksheet->Range("A2:V2")->{'Value'} = ["Account #","Invoice Date","Mobile
Number","User Surname","User Given Name","Airtime Peak Minutes","Airtime
Offpeak Minutes","Airtime Weekend Minutes","Roamer Airtime Usage
Charges","Roamer Toll Charges","Roamer Surcharges","Total Monthly
Charges","Total Airtime Charges","Total Toll Charges","Total Roamer
Charges","Other Charges","Discount","PST Tax","GST Tax","HST Tax","Total
Taxes", "Total Current Charges"];

</SNIPPET>

Now I assume if I want to change the name on the work sheet tab for
$worksheet, the code would be something like this:

$worksheet -> Name("Billing Summary");

I tried this, but it did not work.

So can anybody help me make this work?

Thanks ahead of time...

Willie McDonald
Technical Analyst
British Columbia Lottery Corp.




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

Date: Thu, 23 Nov 2000 14:00:21 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Creating Excel Spreadsheets from data...
Message-Id: <slrn91qqa5.t5u.tadmc@magna.metronet.com>

Willie McDonald <wmcdonald@bclc.com> wrote:

>One of the additions I want to add is
>multiple sheets in a work book, but I need to know how to name any new
>sheets (on the little tab attached to each worksheet in a workbook) that are
>created.


I'd look into the Spreadsheet::WriteExcel module.

(there is an article about it in the Fall "Perl Journal")


-- 
    Tad McClellan                          SGML consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Fri, 24 Nov 2000 00:35:32 GMT
From: Dan Karran <dan@karran.net>
Subject: Determining size of image
Message-Id: <8vkd4k$491$1@nnrp1.deja.com>

Is there any way that I can find the height and width of an image through
perl, by just giving it the location of the file?


Dan


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


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

Date: Fri, 24 Nov 2000 12:03:26 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Determining size of image
Message-Id: <slrn91rfiu.imr.mgjv@martien.heliotrope.home>

On Fri, 24 Nov 2000 00:35:32 GMT,
	Dan Karran <dan@karran.net> wrote:
> Is there any way that I can find the height and width of an image through
> perl, by just giving it the location of the file?

get Image::Size from CPAN. Now, I'm going to give you some URLs that I
want you to bookmark, and always consult first, before you decide to ask
for modules on this group, or clp.modules. Ok?

http://www.cpan.org/
http://search.cpan.org/

if you use ActiveState's Perl port, use the ppm tool to install modules,
and consult their site.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Can't say that it is, 'cause it
Commercial Dynamics Pty. Ltd.   | ain't.
NSW, Australia                  | 


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

Date: Thu, 23 Nov 2000 11:56:26 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: How do you determine the current stack frame depth?
Message-Id: <G4H7u2.DA6@news.muni.cz>

On Thu, 23 Nov 2000 12:36:44 +0100, Craig Manley <c.manley@chello.nl> wrote:
> Hi,
> 
> For logging purposes (using indentations) I'ld like to know the current
> stack frame depth. Is this possible in Perl?
> 
> For example:
> 
> # depth = 0;
> &bla();
> 
> sub bla {
>  # depth = 1
>  &foo();
> }
> 
> sub foo {
>  # depth = 0
> }

Yes, cycle throught caller, incrementing the depth. But for logging
purposes (and for inspiration), Carp module might be helpfull.

Yours,

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
   .project: Perl, DBI, Oracle, MySQL, auth. WWW servers, MTB, Spain.
Petition for a Software Patent Free Europe http://petition.eurolinux.org
------------------------------------------------------------------------


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

Date: 23 Nov 2000 23:14:07 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Most easy way to get IP from a local NIC by device name (eth0,eth1...)
Message-Id: <8vk8bv$pgu$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to 
<mexicanmeatballs@my-deja.com>],
who wrote in article <8veb8s$qb1$1@nnrp1.deja.com>:
> Well, I don't know how portable it is, but it works on Linux and
> everything seems fairly standard in it:
> 
> #!/usr/bin/perl -w
> use strict;
> use Socket;
> 
> my $proto = getprotobyname("udp");
> socket(SOCKET, PF_INET, SOCK_DGRAM, $proto);
> connect(SOCKET, sockaddr_in(0, inet_aton("27.0.0.1")));
> my ($port, @addr) = unpack_sockaddr_in(getsockname(SOCKET));
> my $ip = inet_ntoa($addr[0]);
> print "$ip\n";

On my pretty old version of OS/2 with sl0 running I get 0.0.0.0.  Do
not know what your code is doing, but it is a datapoint.  ;-)

BTW, the answer is the same if I put my nameserver address (remote)
instead of the loopback.

Ilya


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

Date: 23 Nov 2000 11:06:16 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Need a fast $150???  Write (or find) me a couple of scripts and make em' work!
Message-Id: <m1aeaqwlsn.fsf@halfdome.holdit.com>

>>>>> "Al" == Al Rosetti <al@maystreet.com> writes:

Al> So who wants to be a hundredaire? <g>  If you'd like some extra
Al> holiday cash for just a few hours of your time (or even less if these
Al> scripts are already lying around somewhere and you can implement them)
Al> I need your help.

Al>  I need two simple scripts for my website.

Al> An invisible counter to be used on multiple pages

What's an invisible counter?

Al> The second thing I need is a pseudo search tool.  I need a plain HTML
Al> text box and a triggering button.  The user will type in  a
Al> "keyword"... hit enter (or the html trigger button) and this will take
Al> him/her to a page linked to that keyword.

Al> On a practical level the information needs to be stored in a doc/txt
Al> file online that I can easily edit. 

Al> How it oughta work...
Al> A) A user will type in Toyota111
Al> B) The script will search the mini database (txt file)
Al> C) In the text file toyota111 will be associated with the document
Al> "toyota111/index.htm"
Al> D) The browser will be forwarded to that page.
Al> E) If the user enters a keyword with no matchup the browser is
Al> automatically forwarded to "error.htm" or whatever.

    #!/usr/bin/perl
    use CGI qw(:all);

    if (my $keyword = param "keyword") {
      while (<DATA>) {
        chomp;
        if ($_ eq $keyword) {
          print redirect "http://".server_name()."/some/prefix/$keyword/index.htm";
          exit 0;
        }
      }
      print redirect "http://".server_name()."/some/prefix/error.htm";
    } else {
      print header, start_html("pick a keyword"), h1("pick a keyword"),
        startform, textfield('keyword'), submit, endform, end_html;
    }
    __DATA__
    toyota111
    toyota112
    honda35

You can give me $150 via PayPal (merlyn@stonehenge.com) if you wish.
That's a little excessive for 5 minutes of work though. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Fri, 24 Nov 2000 01:19:53 GMT
From: Terrence Brannon <brannon@lnc.usc.edu>
Subject: Re: OOP and information hiding
Message-Id: <lbvgte6u9y.fsf@lnc.usc.edu>

abigail@foad.org (Abigail) writes:

> Unless the implementation is totally irrelevant, it ain't OO. What Perl
> calls OO is nothing more than ADTs with a fancy syntax.

I think that a minimal acceptable definition of OOP is unifying
functions and data into a single programmatic entity. By this
definition, Perl does support OOP.

-- 
Terrence Brannon


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

Date: Thu, 23 Nov 2000 15:42:47 -0400
From: Gil Vautour <vautour@unb.ca>
Subject: Re: Perl DBI
Message-Id: <3A1D7337.89DEE353@unb.ca>

Where can I find some info on "running the proxy"?

c wrote:

> "Gil Vautour" <vautour@unb.ca> wrote in message
> news:3A156887.E2E7712E@unb.ca...
> > Hi all,
> >
> > I have been doing some research on Perl and the DBI module, but I still
> > have a few questions...  The following is my situation and I'm wondering
> >
> > if it is even possible and am I on the right track.  I have Perl running
> >
> > on Unix with an Apache webserver, and I also have a Win98 PC on the
> > network that is running 24/7.  Would I be able to use Perl with the DBI
> > module to access a MS Access database on the windows PC?  If the ODBC
> > DSN is setup on the PC would I be able to connect to the database using
> > Perl?  If so, how do I specify the where the PC and database are using
> > something like :
> >  my $dbh = DBI->connect( "dbi:???", "username", "password" )
> >
> > Thanks
> >
>
> You might be able to  install  the ActiveState distro on the 98 machine and
> run the proxy. It worked fine for me but I used a Linux  NT combination.



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

Date: 23 Nov 2000 19:36:25 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: perl options
Message-Id: <8vjrjp$dsf$1@bob.news.rcn.net>

Flint Slacker <flint@flintslacker.com> wrote:

> I just went through the perl man page and found options like -w to
> print warnings etc.... but I don't believe the list is complete.  I
> remember seeing a --*-***- string in a cgi script one time.  I'm just
> wondering if you can improve performance by turning off certain things
> like syntax checking, etc.....  Does anybody have a complete list?

perl's command-line switches are documented in perlrun.



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

Date: Thu, 23 Nov 2000 14:03:44 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: perl options
Message-Id: <slrn91qqgg.t5u.tadmc@magna.metronet.com>

Flint Slacker <flint@flintslacker.com> wrote:

>can improve performance by turning off certain things
                            ^^^^^^^^^^^
>like syntax checking
      ^^^^^^^^^^^^^^^

Is that a joke?

(if so, you forgot the smiley. if not, then you have a severe
 dearth of knowledge about how programming computers works.
)


-- 
    Tad McClellan                          SGML consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Thu, 23 Nov 2000 19:25:10 -0500
From: Mike Thacker <mike@All-starZ.com>
Subject: PERL PROGRAMMER Wanted
Message-Id: <3A1DB566.47EDFCA1@All-starZ.com>


PERL programmer wanted to maintain existing code modules.

Currently running on UNIX server and OS2 server.
Looking to migrate the UNIX code modules to OS2 server.

"Hourly rate" or "by the job" basis considered.

This is a fairly complex configuration, building dynamic web pages from
a database, so must be proficient in PERL and HTML code syntax.

Please respond with your CREDENTIALS and "links" to examples of your
work. Only experienced professionals, capable of completing tasks
on-time and within budgets need apply.

You should email your info to:  perlpgmr(at)All-starZ(dot)com


Thank you and Best regards,

Michael W. Thacker
President
Simply the Best, Inc.



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

Date: Fri, 24 Nov 2000 01:13:52 GMT
From: Terrence Brannon <brannon@lnc.usc.edu>
Subject: Re: Perl spider performance
Message-Id: <lb4s0y894f.fsf@lnc.usc.edu>

Mario <diab.lito@usa.net> writes:

> is Perl an acceptable choice for a web spider?
an old issue of the Perl Journal (www.tpj.com) has an implementation
of one.

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

-- 
Terrence Brannon


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

Date: Thu, 23 Nov 2000 22:34:16 -0000
From: "Miriam" <cvinfo@mail.com>
Subject: perl2exe, does anybody know this software?
Message-Id: <975019117.182755@tubarao.ip.pt>

Hi group,

I've found perl2exe utility for perl developers.
From what I've read it compiles everything into one single file.
This seems good to avoid curious people from changing or selling my
programs.
Does anybody heard about this software? is it good? any comments?


thanks for any help

Miriam




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

Date: Thu, 23 Nov 2000 21:39:20 +0100
From: Barna <Barna@MegaPage.ch>
Subject: Print output to a Printer
Message-Id: <3A1D8078.5429A275@MegaPage.ch>

Hi All

How can i print something with Win32?
I tried open(PRNT, ">LPT1"); print PRNT "Test"; close(PRNT); and it
worked! But it printed a minute after the operation....
And, my second question, how can I print to a Win32-networkprinter?
Is there a module or something? Maybe Net::Printer? But how do I find
out the port of a printer in a network?

Thanks a lot!

bye!



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

Date: 23 Nov 2000 15:19:14 -0800
From: Petri Oksanen <Petri_member@newsguy.com>
Subject: Re: Print output to a Printer
Message-Id: <8vk8li01voa@edrn.newsguy.com>

In article <3A1D8078.5429A275@MegaPage.ch>, Barna says...

> How can i print something with Win32?
> I tried open(PRNT, ">LPT1"); print PRNT "Test"; close(PRNT);
> and it worked! But it printed a minute after the operation....

Maybe it is related to your printer.
I used to do this a lot some years ago and it worked very well, using the copy
command and the print function in NC.
I tried a filecopy right now on a HP LaserJet 6P, and it worked immediately.
Perhaps your printer is expecting formatted data, or some sort of commands?
Maybe it is so easy that you just need a line-terminator?

> And, my second question, how can I print to a
> Win32-networkprinter?

Make sure you connect the shared printer to a local filename, after that you can
do normal file operations on it.
You can use net.exe:
net use lpt2: \\server\printer0
perl -MFile::Copy -we "copy(\"myfile.txt\", \"lpt2\");"

Or just rightclick on the shared resource and assign a port to it that way.

> But how do I find out the port of a printer in a network?

Connect to it first, that way you're sure of what it's called. :)


Petri Oksanen



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

Date: Fri, 24 Nov 2000 07:55:04 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Problem r/w binary files
Message-Id: <slrn91r118.imr.mgjv@martien.heliotrope.home>

On Wed, 22 Nov 2000 17:31:59 GMT,
	Honza Pazdziora <adelton@fi.muni.cz> wrote:
> On Wed, 22 Nov 2000 15:58:08 GMT, toby_m_kramer@my-deja.com <toby_m_kramer@my-deja.com> wrote:
>> 
>> you can reproduce the problem, let me know.  I am
>> using ActivePerl on Win32.
> 
> Function binmode (perldoc -f binmode) is your friend, on these evil
> systems that put EOFs to random places of your files.

\begin{pedantic}
\cZ is only an end-of-file indicator for text files. The OP didn't have
a text file, so \cZ is a perfectly valid character. The problem isn't
that there are end-of-file markers in the file, but that the OP lied to
perl about what sort of file was being read. On OS's that do make a
distinction between text and binary files, that's important.
\end{pedantic}

But yes, it is evil, unnecessary and silly.

Martien
-- 
Martien Verbruggen              | Since light travels faster than
Interactive Media Division      | sound, isn't that why some people
Commercial Dynamics Pty. Ltd.   | appear bright until you hear them
NSW, Australia                  | speak?


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

Date: Fri, 24 Nov 2000 01:31:40 -0000
From: "Brian Canning" <webmaster@ukdj.freeserve.co.uk>
Subject: Site montior
Message-Id: <8vkgej$g8o$2@newsg2.svr.pol.co.uk>

Hi there

I posed a question up a few weeks, back asking
if there was any way to write a script to test is
a site is working/up.
I did get one reply telling me off a perl module
that could help me do this.

the trouble is I have had a system crash and lost all
emails.

if anybody can help with this script or knows of a module
that can do this please could you let me known.

Thanks

Brian






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

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


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