[17905] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 65 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 15 18:06:05 2001

Date: Mon, 15 Jan 2001 15:05:18 -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: <979599918-v10-i65@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 15 Jan 2001     Volume: 10 Number: 65

Today's topics:
        "Decimal to IP" golf anyone? <russ_jones@rac.ray.com>
    Re: "Decimal to IP" golf anyone? (Rich Lafferty)
    Re: "Decimal to IP" golf anyone? <joe+usenet@sunstarsys.com>
    Re: "Decimal to IP" golf anyone? <uri@sysarch.com>
    Re: "Decimal to IP" golf anyone? <uri@sysarch.com>
    Re: "Decimal to IP" golf anyone? <russ_jones@rac.ray.com>
    Re: 8 letters (Richard Zilavec)
        c function call from Perl <ana.dominguez@centurytel.com>
    Re: Can't associate .PL files in Win98 shiloam@pacbell.net
        Can't get Apache, Win98, and Mod_Perl working. shiloam@my-deja.com
    Re: Code breaking <collin.starkweather@collinstarkweather.com>
        Date question <Waarddebon@chello.nl>
    Re: Date question egwong@netcom.com
    Re: Date question (Abigail)
    Re: exit <tony_curtis32@yahoo.com>
    Re: exit (Aleksandar V.)
    Re: FAQ 8.44:   How do I open a file without blocking? (Abigail)
    Re: Fork lots of children <collin.starkweather@collinstarkweather.com>
        Forward engineering Perl from Dia <collin.starkweather@collinstarkweather.com>
    Re: Forward engineering Perl from Dia <brannon@lnc.usc.edu>
    Re: Help me append (David H. Adler)
    Re: how to test if $a is part of $b?? (Honza Pazdziora)
        Insert value into table using perl/DBI <jing@research.att.com>
    Re: Insert value into table using perl/DBI <kstep@pepsdesign.com>
    Re: Jobs: Senior Software Engineer <russ_jones@rac.ray.com>
    Re: Limits on array and hash storage (Abigail)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 15 Jan 2001 13:57:21 -0600
From: Russ Jones <russ_jones@rac.ray.com>
Subject: "Decimal to IP" golf anyone?
Message-Id: <3A635621.7ABF9F49@rac.ray.com>

I have an IP address that's stored in Oracle as number(12). For
example, the number

2467918155

converted to hex is

93 19 71 4b

which, converted back to decimal a byte at a time, is

147.25.113.75 (viola, my IP address!)

So to get it formatted as a dotted IP, I'm using this:

	$dotted = sprintf("%vd",pack('N',$number));

Works fine, but does anyone have any better ways? Or just different?
Just curious, I learn a lot from these golf matches
-- 
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747

Quae narravi, nullo modo negabo. - Catullus


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

Date: 15 Jan 2001 20:11:54 GMT
From: rich@bofh.concordia.ca (Rich Lafferty)
Subject: Re: "Decimal to IP" golf anyone?
Message-Id: <slrn966mca.v14.rich@bofh.concordia.ca>

In comp.lang.perl.misc,
Russ Jones <russ_jones@rac.ray.com> wrote:
> I have an IP address that's stored in Oracle as number(12). For
> example, the number
> 
> 2467918155
> 
> converted to hex is
> 
> 93 19 71 4b
> 
> which, converted back to decimal a byte at a time, is
> 
> 147.25.113.75 (viola, my IP address!)

"Converted to base 256", shirley. It's just notated using three
decimal places for each base-256 place.

> 	$dotted = sprintf("%vd",pack('N',$number));

        $dotted = inet_ntoa(inet_aton($number));

:-)

I'm afraid I'm not sure how module use figures into a golf score. That
requies Socket.pm.

  -Rich


-- 
Rich Lafferty ----------------------------------------
 Nocturnal Aviation Division, IITS Computing Services
 Concordia University, Montreal, QC
rich@bofh.concordia.ca -------------------------------


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

Date: 15 Jan 2001 15:18:28 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: "Decimal to IP" golf anyone?
Message-Id: <m3wvbwy3fv.fsf@mumonkan.sunstarsys.com>

Russ Jones <russ_jones@rac.ray.com> writes:

> So to get it formatted as a dotted IP, I'm using this:
> 
> 	$dotted = sprintf("%vd",pack('N',$number));

Yours seems to work fine on 5.6 (linux), but not w/ 5.005_03.
( Invalid conversion in printf: "%v" ...)

It's not as nice as yours (and not as short, either), but
here's what I've been using:

        $dotted = join '.', reverse unpack 'C4', pack 'I', $number;

        $number = unpack 'I', pack 'C4', reverse split /\./, $dotted;

-- 
Joe Schaefer



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

Date: Mon, 15 Jan 2001 20:25:44 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: "Decimal to IP" golf anyone?
Message-Id: <x7lmsczho8.fsf@home.sysarch.com>

>>>>> "JS" == Joe Schaefer <joe+usenet@sunstarsys.com> writes:

  JS> Russ Jones <russ_jones@rac.ray.com> writes:
  >> So to get it formatted as a dotted IP, I'm using this:
  >> 
  >> $dotted = sprintf("%vd",pack('N',$number));

  JS> Yours seems to work fine on 5.6 (linux), but not w/ 5.005_03.
  JS> ( Invalid conversion in printf: "%v" ...)

  JS> It's not as nice as yours (and not as short, either), but
  JS> here's what I've been using:

  JS>         $dotted = join '.', reverse unpack 'C4', pack 'I', $number;

  JS>         $number = unpack 'I', pack 'C4', reverse split /\./, $dotted;

yoiks!

this one common way before 5.6:

	perl -le 'print join ".", unpack "C4", pack "N", 2467918155'

use N for network order and you don't need the reverse.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Mon, 15 Jan 2001 20:26:55 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: "Decimal to IP" golf anyone?
Message-Id: <x7k87wzhm8.fsf@home.sysarch.com>

>>>>> "RL" == Rich Lafferty <rich@bofh.concordia.ca> writes:

  RL>         $dotted = inet_ntoa(inet_aton($number));

  RL> I'm afraid I'm not sure how module use figures into a golf score. That
  RL> requies Socket.pm.

unfortunately for you, the keystrokes for the use line or the -M count.

and some golf tournaments (to be unnamed) didn't allow any modules. only
pure perl code was allowed.

uri


-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Mon, 15 Jan 2001 15:18:59 -0600
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: "Decimal to IP" golf anyone?
Message-Id: <3A636943.5998B9AA@rac.ray.com>

Joe Schaefer wrote:
> 
> Russ Jones <russ_jones@rac.ray.com> writes:
> 
> >
> >       $dotted = sprintf("%vd",pack('N',$number));
> 
> Yours seems to work fine on 5.6 (linux), but not w/ 5.005_03.
> ( Invalid conversion in printf: "%v" ...)
> 

I should have said that I'm on 5.6. The "v" conversion is new.

-- 
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747

Quae narravi, nullo modo negabo. - Catullus


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

Date: Mon, 15 Jan 2001 23:04:03 GMT
From: rzilavec@tcn.net (Richard Zilavec)
Subject: Re: 8 letters
Message-Id: <3a637fb7.60106851@news.tcn.net>

On Mon, 15 Jan 2001 15:46:15 +0100, "Per- Fredrik Pollnow"
<Per-fredrik.Pollnow@epk.ericsson.se> wrote:

>Hi,
>I was wondering if you guy's could help me out. This is my mini scipt:

You should post the code your using, this doesn't compile...  

>user strict;
use strict;

>my = ($name);
my($name);

>print "Enter you name: ";chomp($name = <STDIN>);
Now test $name using length:

perldoc -f length

if(length($name) > 8 ) {
   die "Some warning....\n";
}

Now test for the characters entered are vaild, something like:

perldoc perlre

die "Only letters\n" unless($name =~ /^[a-zA-Z]+$/);

>but if the name is longer than 8 letters, I want it to die !!,
>

--
 Richard Zilavec
 rzilavec@tcn.net


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

Date: Mon, 15 Jan 2001 16:29:59 -0600
From: Ana Dominguez <ana.dominguez@centurytel.com>
Subject: c function call from Perl
Message-Id: <3A6379E7.3BA10478@centurytel.com>

Hello,

I need to write a Perl script that will send files using Connect:Direct
(or ndm). This software provides an API for c.

It looks like the only way I can get to write my Perl script is to write
a c program to make the API calls and create a module. My concern is
that the c program that I need to write will generate calls to the
Connect:Direct software to start a session and then send commands (like
create an object and then send messages to it) but I am not sure how the
thread can be kept...I may be totally lost here. Please any advice is
welcome!

Ana



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

Date: Mon, 15 Jan 2001 19:14:05 GMT
From: shiloam@pacbell.net
Subject: Re: Can't associate .PL files in Win98
Message-Id: <93vi5l$tfg$1@nnrp1.deja.com>

In article <3A633BDA.A541401A@mindspring.com>,
  Gary Burton <glburton@mindspring.com> wrote:
>
> John Roth wrote:
>
> > If it isn't finding the executable, the directory with the Perl
executable
> > isn't in your path, or the .lnk file for the DOS session doesn't
specify the
> > correct command - it must specify executing Perl from the proper
directory
> > with the .pl as it's object.
> >
>
> 	.lnk files are shortcuts.  I don't think they have any function
in an association.  Do you perhaps mean a .PIF file?  If so, what would
the name of the file be before the extension?  Is this file you are
talking about it stored on disk, or just in RAM.
>
> 	I associated perl.exe using the browse window, so the path
isn't wrong.
> >
> > I'm going to have to try this! As you've figured out by now, the
real
> > problem is controlling whether the window closes when the program
ends.
> > Micro$oft doesn't seem to have given us quite enough control there.
Pity,
> > but then, we're talking about Micro$oft.
> >
> 	Please let me know how your experiment comes out.
>
> 	I know it isn't running the script because I now have a <stdin>
in the script and it stops for input.  It must be running perl.  On my
first launch after booting the computer, the disk rattles for a second
or so before the DOS window opens.  Once it opens, it just flashes some
error message about 6 words long, then closes.
>
> > >
> > > Related questions:
> > >     *   Have you ever actually SEEN the association work in
Windows 98?
> > If so, I will continue to fight the battle.  By the way, I have the
first
> > edition of Win98; but I don't think that matters.
> >
> > It does work. The problem is with the DOS box, not with the
association.
> > BTW - there's no way of making an association
> > work inside of the DOS box - it's just not part of the Windows
> > specification. DOS only looks for .BAT, .EXE and so forth when it's
looking
> > for executables on the path. It completely ignores any associations.
> >
>
> 	That's what the other guy said, but I didn't want to accept it
easily because the FAQ I referenced from the ActiveState website says
specifically that it will work.  It sounds like you are telling me that
you agree with the other guy, that the FAQ is wrong, and that I can
never make the association do what I want.  Is that what you are saying?
>
> > >     *   My c:\Perl\bin folder contains both Perl.exe and
perl5.6.0.exe.
> > Is there a difference?  If so, what is it?
> >
> > Did you install it twice without uninstalling?
>
> 	No.  I only installed once.
> >
> > >     *   "Learning Perl on Win32 Systems" recommends assigning
a .PLX
> > extension to the scripts as opposed to the .PL extension to avoid
confusion
> > with the Perl libraries.  Yet, the FAQ "How do I associate Perl
scripts with
> > Perl?" and all the examples show the .PL extension.  What do you
think?
> >
> > ActiveState could do a better job. The PL extension is for "Perl
Libraries,"
> > and shouldn't be overloaded for executables. Again, it doesn't
really matter
> > if you keep things separated.
>
> 	Thanks.  I guess I will continue to use the .PLX just for my
own clarity.
> >
> > To put all of this together so it makes sense: What happens when you
> > double-click on a .pl file
> > in Windows 9x is as follows.
> >
> > 1. Windows looks up the .pl extension in the registry, and finds the
> > command, which is "perl %1".
> > 2. Since perl is a DOS program, Windows builds a .lnk file for
the .pl file.
> > This .lnk contains default parameters for DOS
> > 3. Windows launches DOS, using the expanded "perl %1" command as
the initial
> > command to execute.
> > 4. The DOS box attempts to find perl.exe, either on the path or in
the
> > working directory
> > 5. If it finds it, it runs it.
> > 6. When the command completes, the DOS box shuts down, preventing
you from
> > seeing anything you've written to STDOUT.
> >
>
> 	Now I'm even more confused.  This seems to say that you believe
it is running my script.  If that's the case, a <stdin> or sleep 10
would have stopped it.  It also seems to contradict what you said
above.  Maybe I am just having a hard time following.  Please explain,
if you haven't lost patience with me yet.
>
> 	Thanks.
>

Ok, I think everyone is making this just a little bit too complicated.
Yes the perl %1 is what the registry says, and yes, I too have win98
and am running ActivePerl and it runs just fine. However when I enter
an MS-Dos Prompt and type something like myscript.pl it says 'bad
command or filename'. This is because the Perl.exe can't
be 'associated' in DOS. DOS doesn't know what an 'association' is. If I
type 'c:\perl\bin\perl.exe myscript.pl' however, I get satisfactory
results.

Now if you are double-clicking an Icon somewhere in windows, the
association should work, do like the previous engineer said and put
something like;

<STDIN>;

at the end of ALL your scripts until you get the hang of it. <STDIN>
just waits for user input. Good Luck.

Steve Tilden
Instant Perl Fan


Sent via Deja.com
http://www.deja.com/


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

Date: Mon, 15 Jan 2001 19:00:47 GMT
From: shiloam@my-deja.com
Subject: Can't get Apache, Win98, and Mod_Perl working.
Message-Id: <93vhco$sre$1@nnrp1.deja.com>

I am running Windows 98 and have successfully configured Apache 1.3.12
to run just fine. I have recently installed ActivePerl and have been
teaching myself the language. I have Perl 5.6.0 and I have downloaded
the Mod_Perl apache from the Perl site as well. I cannot seem to get it
working however. Everytime I try to use the LoadModule perl_module
modules/ApacheModulePerl or LoadModule perl_module
modules/ApacheModulePerl.dll it doesn't work, and gives me a can't load
module error. When I try to register this dll using regsrv32 it says
that it can't load the dll as well.

If anyone knows how to get around this please let me know.

Steve Tilden
Instant Perl Fan


Sent via Deja.com
http://www.deja.com/


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

Date: Mon, 15 Jan 2001 15:14:28 -0800
From: Collin Starkweather <collin.starkweather@collinstarkweather.com>
To: James Boulter <jbou@bunker79.fsnet.co.uk>
Subject: Re: Code breaking
Message-Id: <3A638454.FB1C30CB@collinstarkweather.com>

James Boulter wrote:
> 
> Dear all,
> 
> I am writting a perl program to translate normal words into code.  In order
> to do this I need to be able to put each letter in a variable through the
> same process.  Is there a way of saying:
> 
> foreach (letter in the $data variable) {
> translate the letter
> }
> If you see what I mean
> Also, each letter could be put into an array, if so, how?

If I see what you mean, this may be what you're looking for:

   my $data = 'foo on you';
   my @data;

   for (split //, $data) {
           print "$_\n";  
           tr/fonyu/uynof/;
           push @data, $_;

   }

   print "data is @data\n";


-Me

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Collin Starkweather                           (303) 428-0100 x 112
Senior Architect                    collin.starkweather@active.com
Active.com, Inc.                 http://www.collinstarkweather.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: Mon, 15 Jan 2001 21:30:44 GMT
From: "Waarddebon" <Waarddebon@chello.nl>
Subject: Date question
Message-Id: <8_J86.690277$%C1.8571208@Flipper>

Let's say I've got the date 21 march 2001 in the variable
$date1.

and the number '1' in the variable $count.

I want to have in the variable $targetdate, the date which is $count days
after $date1. (In this example
$targetdate will contain 22 march 2001). Which code can I use for this ?

Regards,
Mike

Ps: The code must work with lapyears and it must be able to add 360 days or
more ($count) to the variable
$date.




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

Date: Mon, 15 Jan 2001 22:14:47 GMT
From: egwong@netcom.com
Subject: Re: Date question
Message-Id: <rDK86.6181$J%.622466@news.flash.net>

Use Date::Manip (http://search.cpan.org/search?dist=DateManip)

  use Date::Manip;

  $date = ParseDate("21 march 2001"); 
  print $date, "\n"'
  print DateCalc( $date, "+1 days"), "\n"; 

It does a lot more, too.


Waarddebon <Waarddebon@chello.nl> wrote:
> Let's say I've got the date 21 march 2001 in the variable
> $date1.

> and the number '1' in the variable $count.

> I want to have in the variable $targetdate, the date which is $count days
> after $date1. (In this example
> $targetdate will contain 22 march 2001). Which code can I use for this ?

> Regards,
> Mike

> Ps: The code must work with lapyears and it must be able to add 360 days or
> more ($count) to the variable
> $date.




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

Date: 15 Jan 2001 23:00:19 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Date question
Message-Id: <slrn967083.bbn.abigail@tsathoggua.rlyeh.net>

Waarddebon (Waarddebon@chello.nl) wrote on MMDCXCIV September MCMXCIII in
<URL:news:8_J86.690277$%C1.8571208@Flipper>:
:} Let's say I've got the date 21 march 2001 in the variable
:} $date1.
:} 
:} and the number '1' in the variable $count.
:} 
:} I want to have in the variable $targetdate, the date which is $count days
:} after $date1. (In this example
:} $targetdate will contain 22 march 2001). Which code can I use for this ?


http://search.cpan.org



Abigail
-- 
$_ = "\x3C\x3C\x45\x4F\x54" and s/<<EOT/<<EOT/e and print;
Just another Perl Hacker
EOT


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

Date: 15 Jan 2001 14:26:30 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: exit
Message-Id: <87n1cslfyh.fsf@limey.hpcc.uh.edu>

>> On Mon, 15 Jan 2001 18:46:12 GMT,
>> sandywadkins123@my-deja.com said:

> Perl 5, HTML, little java script.  Ok I wrote scripts
> making each user have a temp. file (xxx.dat). When they
> sumit it updates a file, then gets deleted.

> Question: if they don't submit and close it the file is
> hanging out there. So how can I capture when they exit?

Sorry, too many dangling referents.  I appreciate English
may not be your first language, but more details are
required here to help people understand what you are
trying to do.  There are too many "it"s and missing nouns
to allow someone to know what does what and to what.

hth
t
-- 
Eih bennek, eih blavek.


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

Date: 15 Jan 2001 22:40:37 GMT
From: acabox@yahoo.com (Aleksandar V.)
Subject: Re: exit
Message-Id: <slrn966urq.p5.acabox@localhost.localdomain>

>
>Sorry, too many dangling referents.  I appreciate English
>may not be your first language, but more details are
>required here to help people understand what you are
>trying to do.  There are too many "it"s and missing nouns
>to allow someone to know what does what and to what.
>
>hth
>t
>-- 
>Eih bennek, eih blavek.


English is my second language too, so don't be too sure that
I have deciphered the OP's message correctly:

What he need's is probably to delete a temporary file created
on server, in the case that users leaves his site without submitting
the form/invoking some perl cgi script.

A form can be submitted with onUnload event which is invoked by
surfing to another web site or by closing the browser window.

<body onUnload="document.FormName.submit()">


-- 
~ Sascha.
My opinions may have changed, but not the fact that I am right.
(Ashleigh Brilliant)


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

Date: 15 Jan 2001 22:31:50 GMT
From: abigail@foad.org (Abigail)
Subject: Re: FAQ 8.44:   How do I open a file without blocking?
Message-Id: <slrn966uim.bbn.abigail@tsathoggua.rlyeh.net>

Chris Fedde (cfedde@fedde.littleton.co.us) wrote on MMDCXCIV September
MCMXCIII in <URL:news:mbH86.969$B9.192940544@news.frii.net>:
 .. In article <Xns902AA9AA1fightagainstspamcuth@195.141.200.222>,
 .. Reto Hersiczky <fight_against_spam_cut_here_retoh@dplanet.ch> wrote:
 .. >
 .. >Could pls. somebody explain any sense for reading a file without blocking
 .. >besides a real-time application? As far as I can imagine, this mode makes
 .. >no sense in a CGI/modperl-based application. Tell me, if I'm wrong.
 .. >--Reto
 .. >
 .. >
 .. 
 .. I think that you lack creativity.  What if the cgi checks to
 .. see if there is data avaialble on some serial port?  


Or *gasp* what if someone uses Perl outside of a CGI environment?

Or would that be too farfetched to consider?



Abigail
-- 
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");


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

Date: Mon, 15 Jan 2001 15:24:14 -0800
From: Collin Starkweather <collin.starkweather@collinstarkweather.com>
To: Bill Buchan <wbuchan@uk.noha-systems.com>
Subject: Re: Fork lots of children
Message-Id: <3A63869E.D67F2AE3@collinstarkweather.com>

Bill Buchan wrote:
> 
> I'd like to run a number of processes at the same time (unix).
> 
> I've been using fork but I seem to have to create a child process, then
> spawn a child from the child, and a child from this child etc. until I
> have a whole heirarchy of children.  This works but the code is a real
> mess.
> 
> All I want is one parent and multiple children all at the same level in
> the process heirarchy.  Is this possible?  Or is there a better way to
> go about it - ie. other than fork?  Or does somebody have a tidier bit
> of code to do this!?
> 
> Many thanks for any information
> - Bill.
> 
> Sent via Deja.com
> http://www.deja.com/

You'll find what you need in the Perl Cookbook.

-Me

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Collin Starkweather                           (303) 428-0100 x 112
Senior Architect                    collin.starkweather@active.com
Active.com, Inc.                 http://www.collinstarkweather.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: Mon, 15 Jan 2001 15:06:06 -0800
From: Collin Starkweather <collin.starkweather@collinstarkweather.com>
Subject: Forward engineering Perl from Dia
Message-Id: <3A63825E.90D4070F@collinstarkweather.com>

I have written basic Perl forward-engineering for Dia
(http://www.lysator.liu.se/~alla/dia) into Javier O'Hara's dia2code
(http://sourceforge.net/projects/dia2code) (authored in C), but now that
I've accomplished the basics, I would like to solicit some comments from
anyone out there who may be interested.

There are four basic approaches I'm considering, and any comments or
advice would be appreciated.

1)  Generate all of the Perl explicitly from dia2code.  This would
retain dia2code intact as a standalone app.  Additionally, the C could
potentially be used via XS to facilitate a generic Perl code generation
module.

2)  Generate skeletons with h2xs and modify them as necessary.

3)  Use existing CPAN modules for the code generation.  One that I've
seen that seem as if they may fulfill some useful function in this
regard are Class::Classgen::*, though it is not entirely generic in its
attribute and operation definition.  Are there any other modules out
there either on the CPAN or off that are being developed for the
purposes of Perl code generation?

4)  Write my own code generation modules in Perl, then access them from
dia2code.

-Collin

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Collin Starkweather                           (303) 428-0100 x 112
Senior Architect                    collin.starkweather@active.com
Active.com, Inc.                 http://www.collinstarkweather.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: Mon, 15 Jan 2001 22:51:55 GMT
From: Terrence Brannon <brannon@lnc.usc.edu>
Subject: Re: Forward engineering Perl from Dia
Message-Id: <lbofx8tomx.fsf@lnc.usc.edu>

Collin Starkweather <collin.starkweather@collinstarkweather.com> writes:

> I have written basic Perl forward-engineering for Dia

What is meant by Perl forward-engineering?

> (http://www.lysator.liu.se/~alla/dia) into Javier O'Hara's dia2code
> (http://sourceforge.net/projects/dia2code) (authored in C), but now that
> I've accomplished the basics, I would like to solicit some comments from
> anyone out there who may be interested.

Is what you did documented? Does it have examples? I went to the URLs
above and saw 2 other people's projects. I still have no idea what you
did and how it relates to the above 2 things. 

My guess is you have come up with some way of programming perl visually?

> 
> There are four basic approaches I'm considering, and any comments or
> advice would be appreciated.
> 
> 1)  Generate all of the Perl explicitly from dia2code.  This would
> retain dia2code intact as a standalone app.  Additionally, the C could
> potentially be used via XS to facilitate a generic Perl code generation
> module.
> 
> 2)  Generate skeletons with h2xs and modify them as necessary.

Well, XS is supposed to be thrown out with Perl 6. Correct me if I'm wrong.

> 3)  Use existing CPAN modules for the code generation.  One that I've
> seen that seem as if they may fulfill some useful function in this
> regard are Class::Classgen::*, though it is not entirely generic in its

thanks for pointing this one out to me. I hadn't heard of it. looks
interesting. 

> attribute and operation definition.  Are there any other modules out
> there either on the CPAN or off that are being developed for the
> purposes of Perl code generation?

Jon Orwant's Ph.D thesis involved writting Perl programs that wrote
Perl programs that solved game theory problems. He is kind of busy
with Perl Journal litigation, but seeing as you appear to have an
academic email, you may be able to get his thesis via microfilm.

And of course Template Toolkit can be used to generate or call
pre-generated Perl code.

> 4)  Write my own code generation modules in Perl, then access them from
> dia2code.

I still don't know your ultimate goal, to generate Perl code or to
generate C++/java?

-- 
Terrence Brannon
Carter's Compass...
    I know I'm on the right track when by deleting code I'm adding
    functionality.


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

Date: 15 Jan 2001 20:14:15 GMT
From: dha@panix2.panix.com (David H. Adler)
Subject: Re: Help me append
Message-Id: <slrn966mgn.h67.dha@panix2.panix.com>

On Mon, 15 Jan 2001 09:36:57 GMT, jbuff <jbuff1856@my-deja.com> wrote:
>
>This begs the question "Is brian d foy a real person?".
>
>Or is he a construct like Alan Smithee?

There is an actual person who uses brian d foy as his name.  Whether
or not he is "real" probably depends on what you mean by real.  :-)

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
I have 'somefunc' bound to the 'any' key.
	- Jim Flanagan, c.l.p.misc


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

Date: Sun, 14 Jan 2001 18:24:47 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: how to test if $a is part of $b??
Message-Id: <G760HB.qJ@news.muni.cz>

On Sun, 14 Jan 2001 11:01:32 -0700, Michael Cook <mikecook@cigarpool.com> wrote:
> See if this works for you:
> ~~~~~
> #!/bin/perl
> $a="this is a test";
> $b=" is a";
> if ( $a =~ $b )

This won't work correctly if $b eq '.', for example. Either use \Q or
check

	perldoc -f index

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: Mon, 15 Jan 2001 20:08:41 GMT
From: Jing Zhou <jing@research.att.com>
Subject: Insert value into table using perl/DBI
Message-Id: <3A6358C9.7A4B22D0@research.att.com>

I have been trying to populate a table in my database using perl/DBI , I
was able to establish the connection to the database, it failed to do
the insert. The error message was :
Can't mix placeholder styles (1/2) at  c:/perl/site/lib/DBD/ODBC.pm.

Any suggestions?


PS. I run the perl script using Activeperl on Win2000



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

Date: Mon, 15 Jan 2001 16:44:08 -0500
From: "Kurt Stephens" <kstep@pepsdesign.com>
Subject: Re: Insert value into table using perl/DBI
Message-Id: <93vqtp$ce3$1@slb7.atl.mindspring.net>

"Jing Zhou" <jing@research.att.com> wrote in message
news:3A6358C9.7A4B22D0@research.att.com...
> I have been trying to populate a table in my database using perl/DBI , I
> was able to establish the connection to the database, it failed to do
> the insert. The error message was :
> Can't mix placeholder styles (1/2) at  c:/perl/site/lib/DBD/ODBC.pm.
>
> Any suggestions?

Please post a copy of the code that causes the error.  It looks like you
have a problem with the (?) placeholders in your SQL statement.

Kurt Stephens





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

Date: Mon, 15 Jan 2001 13:47:26 -0600
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: Jobs: Senior Software Engineer
Message-Id: <3A6353CE.30CE493D@rac.ray.com>

Abigail wrote:
> 
> 
> I post here as well. But I won't let myself be hired by someone who is
> clueless. Posting job ads here shows cluelessness.
> 


I post here, and I'm a well known moron. How much you paying'?
-- 
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747

Quae narravi, nullo modo negabo. - Catullus


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

Date: 15 Jan 2001 22:36:07 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Limits on array and hash storage
Message-Id: <slrn966uqn.bbn.abigail@tsathoggua.rlyeh.net>

Rich Lafferty (rich@bofh.concordia.ca) wrote on MMDCXCIV September
MCMXCIII in <URL:news:slrn966735.env.rich@bofh.concordia.ca>:
\\ In comp.lang.perl.misc,
\\ William Cardwell <EUSWMCL@am1.ericsson.se> wrote:
\\ > Hello,
\\ > 
\\ > I notice that large arrays and hashes are commonly used in Perl. I do
\\ > the same and have not yet hit limits. Am I really using only ram?
\\ 
\\ Possibly swap, also. Depends on your operating system.


Really? There are operating systems that have swap that's located in
memory that cannot be randomly accessed? Swap on punch cards does exist?



Abigail
-- 
$_ = "\x3C\x3C\x45\x4F\x54" and s/<<EOT/<<EOT/e and print;
Just another Perl Hacker
EOT


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

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 V10 Issue 65
*************************************


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