From tim at consultix-inc.com Fri Mar 1 01:56:25 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:47 2004 Subject: SPUG: Re: HTTP Cookies Message-ID: <20020228235625.B6848@timji.consultix.wa.com> ----- Forwarded message from owner-spug-list@pm.org ----- From: owner-spug-list@pm.org Date: Thu, 28 Feb 2002 17:14:05 -0600 X-Authentication-Warning: mail.pm.org: majordomo set sender to owner-spug-list@pm.org using -f To: spug-list-approval@pm.org Subject: BOUNCE spug-list@pm.org: Admin request of type /^Zub\b/i at line 8 >From tim@consultix-inc.com Thu Feb 28 17:13:01 2002 Received: from grace.speakeasy.org (grace.speakeasy.org [216.254.0.2]) by mail.pm.org (8.11.6/8.11.3) with SMTP id g1SND0O16743 for ; Thu, 28 Feb 2002 17:13:01 -0600 Received: (qmail 25483 invoked by uid 8592); 28 Feb 2002 23:12:03 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 28 Feb 2002 23:12:03 -0000 Date: Thu, 28 Feb 2002 15:12:03 -0800 (PST) From: "Sanford M Morton Jr." X-X-Sender: morton@grace.speakeasy.net To: S Bullo cc: "Seattle Perl User's Group" Subject: Re: SPUG: RE: HTTP::Cookies question In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Here's a login function that used to work for me. It should provide a template for you unless the api has changed. my $jar = HTTP::Cookies->new ('file' => 'cookies.txt', 'autosave' => 1); login($jar, $username, $password); # logs in, sets cookies in cookie jar Zub login { my ($jar, $username, $password, $url) = @_; my $ua = new LWP::UserAgent; my $req = new HTTP::Request ('POST', $url ); $req->content_type('application/x-www-form-urlencoded'); $req->content("Username=$username&Password=$password&x=1&y=1"); my $resp = $ua->request($req); if ($resp->is_success or $resp->is_redirect) { $jar->extract_cookies($resp); $jar->save; } else { die $resp->as_string; } 1; } After this, there should be a cookie in the $jar which you can add to a $request: my $request = new HTTP::Request ('GET', $another_url); $jar->add_cookie_header($request); ----- End forwarded message ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From richard at richard-anderson.org Fri Mar 1 09:03:00 2002 From: richard at richard-anderson.org (Richard Anderson) Date: Wed Aug 4 00:08:47 2004 Subject: SPUG: Re: Using mkpath (was: HTTP::Cookies question) References: <00a801c1c0a2$303a5a10$2088ddd1@aciwin> <8/wf8gzkgC6a092yn@efn.org> Message-ID: <014701c1c132$3a75f8a0$2088ddd1@aciwin> No need to use eval, which introduces unneeded complexity and slows execution speed. File::Path::mkpath returns the number of directories successfully created, so the right way to call it is: use File::Path qw(mkpath); unless (mkpath($nameOfNewDir)) { die "Can't create directory $nameOfNewDir: $!"; } Cheers, Richard richard@richard-anderson.org www.richard-anderson.org www.raycosoft.com ----- Original Message ----- From: "Yitzchak Scott-Thoennes" To: Cc: Sent: Thursday, February 28, 2002 9:22 PM Subject: Re: SPUG: Re: HTTP::Cookies question > In article <00a801c1c0a2$303a5a10$2088ddd1@aciwin>, > "Richard Anderson" wrote: > >On an unrelated note, it is more portable and less error prone to use > >use File::Path; > >mkpath($newdir) > > > >than > >system "mkdir -p $newdir" > >since on some OSes mkdir does not have the -p option. > > To be equivalent, you need to make that: > eval { mkpath($newdir) } > since mkpath croaks on errors. > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From sthoenna at efn.org Fri Mar 1 11:42:26 2002 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Wed Aug 4 00:08:47 2004 Subject: SPUG: Re: Using mkpath References: <00a801c1c0a2$303a5a10$2088ddd1@aciwin> <8/wf8gzkgC6a092yn@efn.org> <014701c1c132$3a75f8a0$2088ddd1@aciwin> Message-ID: In article <014701c1c132$3a75f8a0$2088ddd1@aciwin>, "Richard Anderson" wrote: >No need to use eval, which introduces unneeded complexity and slows >execution speed. File::Path::mkpath returns the number of directories >successfully created, so the right way to call it is: > >use File::Path qw(mkpath); >unless (mkpath($nameOfNewDir)) { > die "Can't create directory $nameOfNewDir: $!"; >} Three points: 1) The system "mkdir" version would ignore errors, so an equivalent mkpath should too. 2) The above code is definitely wrong. If mkpath has an error, it will die and your die call will not be triggered. The only case where mkpath returns false is if the directory already exists. Dieing with "Can't create directory" in this case seems a little absurd. The only way to check if mkpath had an error is with eval. 3) eval BLOCK has little overhead. I think you are thinking of eval EXPR. > >Cheers, >Richard >richard@richard-anderson.org >www.richard-anderson.org >www.raycosoft.com >----- Original Message ----- >From: "Yitzchak Scott-Thoennes" >To: >Cc: >Sent: Thursday, February 28, 2002 9:22 PM >Subject: Re: SPUG: Re: HTTP::Cookies question > > >> In article <00a801c1c0a2$303a5a10$2088ddd1@aciwin>, >> "Richard Anderson" wrote: >> >On an unrelated note, it is more portable and less error prone to use >> >use File::Path; >> >mkpath($newdir) >> > >> >than >> >system "mkdir -p $newdir" >> >since on some OSes mkdir does not have the -p option. >> >> To be equivalent, you need to make that: >> eval { mkpath($newdir) } >> since mkpath croaks on errors. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From cmeyer at helvella.org Fri Mar 1 12:15:56 2002 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:08:47 2004 Subject: SPUG: Re: Using mkpath (was: HTTP::Cookies question) In-Reply-To: <014701c1c132$3a75f8a0$2088ddd1@aciwin>; from richard@richard-anderson.org on Fri, Mar 01, 2002 at 07:03:00AM -0800 References: <00a801c1c0a2$303a5a10$2088ddd1@aciwin> <8/wf8gzkgC6a092yn@efn.org> <014701c1c132$3a75f8a0$2088ddd1@aciwin> Message-ID: <20020301101556.B18535@hobart.helvella.org> Hi Richard, On Fri, Mar 01, 2002 at 07:03:00AM -0800, Richard Anderson wrote: > No need to use eval, which introduces unneeded complexity and slows > execution speed. File::Path::mkpath returns the number of directories Eval with a string form can slow execution speed, but eval with the block form is the appropriate way to capture fatal errors, and causes no significant speed slowdown. You can test with Benchmark; I have. > successfully created, so the right way to call it is: > > use File::Path qw(mkpath); > unless (mkpath($nameOfNewDir)) { > die "Can't create directory $nameOfNewDir: $!"; > } Despite the lacking documentation, File::Path's mkpath *does* throw a fatal error if it encounters problems creating a directory. Here's the offending line from that module: croak "mkdir $path: $e" unless -d $path; Your code's die statement will never be reached if there is a problem. If you asked mkpath to make no directories, then your code could reach the die statement. Try: #!/usr/local/bin/perl use File::Path; my $result = mkpath('/usr/bogus'); print $result?'yay':'nay', "\n"; __END__ The print statement never gets run, because the fatal error aborts the program before hand. Have fun, -C. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From dancerboy at strangelight.com Fri Mar 1 12:41:52 2002 From: dancerboy at strangelight.com (dancerboy) Date: Wed Aug 4 00:08:47 2004 Subject: SPUG: Re: Using mkpath (was: HTTP::Cookies question) In-Reply-To: <014701c1c132$3a75f8a0$2088ddd1@aciwin> References: <00a801c1c0a2$303a5a10$2088ddd1@aciwin> <8/wf8gzkgC6a092yn@efn.org> <014701c1c132$3a75f8a0$2088ddd1@aciwin> Message-ID: At 7:03 am -0800 3/1/02, Richard Anderson wrote: >No need to use eval, which introduces unneeded complexity and slows >execution speed. File::Path::mkpath returns the number of directories >successfully created, so the right way to call it is: > >use File::Path qw(mkpath); >unless (mkpath($nameOfNewDir)) { > die "Can't create directory $nameOfNewDir: $!"; >} Huh? 1. The whole point of using eval{ } is so that the script WON'T die if mkpath() fails. 2. In the above code, if mkpath() actually fails, your die instruction will never get executed (because mkpath() will have already croak'ed before Perl finishes evaluating the unless() clause). 3. mkpath() returns the directories actually *created* -- therefore, the above code will die if $nameOfNewDir already exists (and since this isn't an error condition, $! won't be set to anything meaningful). To be accurate, you ought to rewrite the die message something like this: unless (mkpath($nameOfNewDir)) { die "No new directories created. ($nameOfNewDir already exists?)"; } But I doubt if this is really the program behaviour that you want. 4. eval{ } does not slow down program execution significantly. (Don't confuse eval{ } with eval() -- the latter form takes a string, and *is* slower, because it needs to compile the string. The former form takes a code block and simply tells the compiler to handle fatal errors inside that code block a non-fatal way.) Moreover, eval{ } *is* the only mechanism for suppressing/capturing fatal errors.[*] -jason [*] At least, it's the only *reasonable* method. I mean, you could fork off a child process and execute the code in the child (and getting the result by opening pipes to the child's STDERR, e.g. using IPC::Open3), or save the code into a file and execute it through qx{ }, or use any number of other utterly pathological techniques... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From richard at richard-anderson.org Fri Mar 1 12:59:55 2002 From: richard at richard-anderson.org (Richard Anderson) Date: Wed Aug 4 00:08:47 2004 Subject: SPUG: Re: Using mkpath (was: HTTP::Cookies question) References: <00a801c1c0a2$303a5a10$2088ddd1@aciwin> <8/wf8gzkgC6a092yn@efn.org> <014701c1c132$3a75f8a0$2088ddd1@aciwin> <20020301101556.B18535@hobart.helvella.org> Message-ID: <017301c1c153$4a09d810$2088ddd1@aciwin> Thanks for the correction. Since File::Path is part of the standard Perl distribution and is five years old, I would have expected accurate documentation. Perhaps I should have looked elsewhere than "perldoc File::Path"? Is this (I hope) an aberration or are module users expected to scan the source code before using a module? Cheers, Richard richard@richard-anderson.org www.richard-anderson.org www.raycosoft.com ----- Original Message ----- From: "Colin Meyer" To: "Richard Anderson" Cc: "Yitzchak Scott-Thoennes" ; Sent: Friday, March 01, 2002 10:15 AM Subject: Re: SPUG: Re: Using mkpath (was: HTTP::Cookies question) > Hi Richard, > > On Fri, Mar 01, 2002 at 07:03:00AM -0800, Richard Anderson wrote: > > No need to use eval, which introduces unneeded complexity and slows > > execution speed. File::Path::mkpath returns the number of directories > > Eval with a string form can slow execution speed, but eval with the > block form is the appropriate way to capture fatal errors, and causes > no significant speed slowdown. You can test with Benchmark; I have. > > > successfully created, so the right way to call it is: > > > > use File::Path qw(mkpath); > > unless (mkpath($nameOfNewDir)) { > > die "Can't create directory $nameOfNewDir: $!"; > > } > > Despite the lacking documentation, File::Path's mkpath *does* throw > a fatal error if it encounters problems creating a directory. Here's > the offending line from that module: > croak "mkdir $path: $e" unless -d $path; > > Your code's die statement will never be reached if there is a problem. > If you asked mkpath to make no directories, then your code could reach > the die statement. > > Try: > #!/usr/local/bin/perl > use File::Path; > > my $result = mkpath('/usr/bogus'); > print $result?'yay':'nay', "\n"; > __END__ > > The print statement never gets run, because the fatal error aborts the > program before hand. > > Have fun, > -C. > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From cmeyer at helvella.org Fri Mar 1 13:43:53 2002 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:08:47 2004 Subject: SPUG: Re: Using mkpath (was: HTTP::Cookies question) In-Reply-To: <017301c1c153$4a09d810$2088ddd1@aciwin>; from richard@richard-anderson.org on Fri, Mar 01, 2002 at 10:59:55AM -0800 References: <00a801c1c0a2$303a5a10$2088ddd1@aciwin> <8/wf8gzkgC6a092yn@efn.org> <014701c1c132$3a75f8a0$2088ddd1@aciwin> <20020301101556.B18535@hobart.helvella.org> <017301c1c153$4a09d810$2088ddd1@aciwin> Message-ID: <20020301114353.B18677@hobart.helvella.org> On Fri, Mar 01, 2002 at 10:59:55AM -0800, Richard Anderson wrote: > Thanks for the correction. Since File::Path is part of the standard Perl > distribution and is five years old, I would have expected accurate > documentation. Perhaps I should have looked elsewhere than "perldoc > File::Path"? Is this (I hope) an aberration or are module users expected to > scan the source code before using a module? Well, I should hope that modules would be useful without needing to read the sourcecode. I think that is the holy grail of reusable code, OO or otherwise. Unfortunately that just isn't always the case. Especially with CPAN modules, where there is no standard for entry. They even let *me* upload a module for any fool^h^h^h^h programmer in the world to use. I am in the habit of reading the source to CPAN modules. It is really a neat thing to have such an enormous repository of incredibly diverse code. I do this for a hobby, in my spare time. I hate having to read module code at work, while I should be thinking about my own problems. One would expect that core modules would need to pass some inspection of the peer community, and they do: it's called p5p, and its echos. Jarkko has recently put out the call for folks to heavily test core modules to be included with soon-to-be-shipped 5.8.0. However, it is sadly true that no group of programmers, however clever they may be, are perfect. Perl is an open source, community oriented project. I think that if we, the users of Perl, agree that modules should be usable by reading their documentation, then it is our responsibility to make sure that they are. I've mailed a patch of a suggested documentation change to Tim Bunce and Charles Bailey, authors of File::Path. Unfortunately, this is a core module and it is very unlikely that it will be updated from the CPAN on most Perl installations. Maybe they'll change the docs in time for shipping with 5.8.0. As an aside, Ingy's NAPC concept will help address the staticness of core modules. Have fun, -C. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From dancerboy at strangelight.com Fri Mar 1 15:12:23 2002 From: dancerboy at strangelight.com (dancerboy) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: Re: Using mkpath (was: HTTP::Cookies question) In-Reply-To: <017301c1c153$4a09d810$2088ddd1@aciwin> References: <00a801c1c0a2$303a5a10$2088ddd1@aciwin> <8/wf8gzkgC6a092yn@efn.org> <014701c1c132$3a75f8a0$2088ddd1@aciwin> <20020301101556.B18535@hobart.helvella.org> <017301c1c153$4a09d810$2088ddd1@aciwin> Message-ID: At 10:59 am -0800 3/1/02, Richard Anderson wrote: >Thanks for the correction. Since File::Path is part of the standard Perl >distribution and is five years old, I would have expected accurate >documentation. Nitpick: the documentation is not *inaccurate*, it's simply *incomplete*. File::Path behaves exactly as documented -- the documentation just doesn't specify what happens upon failure. > Is this (I hope) an aberration or are module users expected to >scan the source code before using a module? It's an aberration in the sense that the documentation certainly *ought* to specify mkpath's behaviour upon failure. OTOH, given that we live in an imperfect world, part of a developer's job is to notice when documentation leaves certain behaviours unspecified, and to plan accordingly. One doesn't need to scan the source code to be aware that, based only on the documentation, one has no idea what happens when mkpath is unable to create the desired path. -jason - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From sthoenna at efn.org Fri Mar 1 15:05:58 2002 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: Re: Using mkpath References: <00a801c1c0a2$303a5a10$2088ddd1@aciwin> <8/wf8gzkgC6a092yn@efn.org> <014701c1c132$3a75f8a0$2088ddd1@aciwin> <20020301101556.B18535@hobart.helvella.org> <017301c1c153$4a09d810$2088ddd1@aciwin> <20020301114353.B18677@hobart.helvella.org> Message-ID: <20+f8gzkgKSU092yn@efn.org> In article <20020301114353.B18677@hobart.helvella.org>, Colin Meyer wrote: >On Fri, Mar 01, 2002 at 10:59:55AM -0800, Richard Anderson wrote: >> Thanks for the correction. Since File::Path is part of the standard Perl >> distribution and is five years old, I would have expected accurate >> documentation. Perhaps I should have looked elsewhere than "perldoc >> File::Path"? Is this (I hope) an aberration or are module users expected to >> scan the source code before using a module? I don't seem to have received the above post from the list. Is there an archive somewhere? Anyway, the documentation is terse but accurate. It just doesn't mention error conditions at all. It says it returns a list of the created directories. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From richard at richard-anderson.org Fri Mar 1 19:24:52 2002 From: richard at richard-anderson.org (Richard Anderson) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: Re: Using mkpath References: <00a801c1c0a2$303a5a10$2088ddd1@aciwin> <8/wf8gzkgC6a092yn@efn.org> <014701c1c132$3a75f8a0$2088ddd1@aciwin> <20020301101556.B18535@hobart.helvella.org> <017301c1c153$4a09d810$2088ddd1@aciwin> <20020301114353.B18677@hobart.helvella.org> <20+f8gzkgKSU092yn@efn.org> Message-ID: <001201c1c189$12e32180$1a88ddd1@aciwin> Well, we've probably beaten this to death, but since you mentioned it the File::Path::mkpath documentation is NOT accurate. The documentation says "It [mkpath] returns a list of all directories ... created." In fact, if mkpath encounters a permissions problem, etc. it does NOT return a list of directories, it throws a runtime error and the calling routine never gets the list of directories. I'm indulging in whining here, but I can't help but observe that the implementation of mkpath goes against common sense. The authors compounded their error by documenting the module incorrectly. Cheers, Richard richard@richard-anderson.org www.richard-anderson.org www.raycosoft.com ----- Original Message ----- From: "Yitzchak Scott-Thoennes" To: Cc: Sent: Friday, March 01, 2002 1:05 PM Subject: Re: SPUG: Re: Using mkpath > In article <20020301114353.B18677@hobart.helvella.org>, > Colin Meyer wrote: > >On Fri, Mar 01, 2002 at 10:59:55AM -0800, Richard Anderson wrote: > >> Thanks for the correction. Since File::Path is part of the standard Perl > >> distribution and is five years old, I would have expected accurate > >> documentation. Perhaps I should have looked elsewhere than "perldoc > > >> File::Path"? Is this (I hope) an aberration or are module users expected to > >> scan the source code before using a module? > > I don't seem to have received the above post from the list. > Is there an archive somewhere? > > Anyway, the documentation is terse but accurate. It just doesn't > mention error conditions at all. It says it returns a list of the > created directories. > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From c8h at cmmail.com Sat Mar 2 11:26:06 2002 From: c8h at cmmail.com (china-lutong) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: Head & Rotor VE(CHINA-LuTong) 03/02 Message-ID: <20020302172517.05F98489EC@mail1.panix.com> Dear Sir, My name is ChenHua, and I'm writing on behalf of the China-Lutong mechanical company. Located in the south east of China, we specialize in hydraulic heads for the VE distributor pump. We can supply standard, good quality units at a very competitive price. The following types are available: Engine model VE PUMS code NO UNIT PRICE(EX WORKS) ISUZU) NP-VE4/11L 096400-1600 $USD40 (NIPPON DENSO) ISUZU NP-VE4/11R 146402-0820(zexel) $USD45 ISUZU NP-VE4/11L 146402-0920(zexel) $USD40 ISUZU NP-VE4/11L 146402-3820(zexel) $USD45 NISSAN NP-VE4/12R 146402-4320(zexel) $USD50 IVECO NP-VE4/11R 1 468 334 798(BOSCH) $USD45 CUMMINS NP-VE6/12R 1 468 336 423(BOSCH) $USD50 In addition,the following models have been produced by us,but there is no stock at present. 096400-1240 (NIPPON DENSO) 1 468 333 320(BOSCH) 1 468 333 323(BOSCH) 2 468 334 021(BOSCH) 2 468 334 050(BOSCH) 1 468 334 313(BOSCH) 1 468 334 565(BOSCH) 1 468 334 580(BOSCH) 1 468 334 590(BOSCH) 1 468 334 596(BOSCH) 1 468 334 603(BOSCH) 1 468 334 604(BOSCH) 1 468 334 666(BOSCH) 1 468 334 675(BOSCH) 1 468 334 837(BOSCH) 1 468 334 874(BOSCH) 1 468 334 899(BOSCH) 2 468 335 022(BOSCH) 1 468 336 371(BOSCH) 1 468 336 418(BOSCH) 1 468 336 528(BOSCH) 1 468 336 464(BOSCH) 1 468 336 480(BOSCH) 2 468 336 013(BOSCH) 1 468 336 614(BOSCH) 146400-8821(zexel) 146402-4020(zexel) VE distributor head: 3-cyl:USD:45/1pcs 4-cyl:USD:45/1pcs 5-cyl:USD:50/1pcs 6-cyl:USD:50/1pcs Minimum order is 48pcs a model. We also can make to order for other models as required. We use precision forging technology to create our products and surface treat them using an imported shot-blasting machine. The constant grinding process guarantees identical clearance in each plunger. Because we have been in the field of diesel fuel injection systems for quite a few years, we are acquainted with many domestic manufacturers of, and sales agents for, parts such as injector nozzles, plungers, delivery valves and so on. If you are interested in our products, please contact me. Thank you for your interest in our company. C.Hua Sales & purchasing director HTTP://WWW.China-LuTong.COM c.h@china-lutong.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From c8h at cmmail.com Sun Mar 3 00:07:14 2002 From: c8h at cmmail.com (china-lutong) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: Head & Rotor VE(CHINA-LuTong) 03/03 Message-ID: <200203030607.g2367hO31219@mail.pm.org> Dear Sir, My name is ChenHua, and I'm writing on behalf of the China-Lutong mechanical company. Located in the south east of China, we specialize in hydraulic heads for the VE distributor pump. We can supply standard, good quality units at a very competitive price. The following types are available: Engine model VE PUMS code NO UNIT PRICE(EX WORKS) ISUZU) NP-VE4/11L 096400-1600 $USD40 (NIPPON DENSO) ISUZU NP-VE4/11R 146402-0820(zexel) $USD45 ISUZU NP-VE4/11L 146402-0920(zexel) $USD40 ISUZU NP-VE4/11L 146402-3820(zexel) $USD45 NISSAN NP-VE4/12R 146402-4320(zexel) $USD50 IVECO NP-VE4/11R 1 468 334 798(BOSCH) $USD45 CUMMINS NP-VE6/12R 1 468 336 423(BOSCH) $USD50 In addition,the following models have been produced by us,but there is no stock at present. 096400-1240 (NIPPON DENSO) 1 468 333 320(BOSCH) 1 468 333 323(BOSCH) 2 468 334 021(BOSCH) 2 468 334 050(BOSCH) 1 468 334 313(BOSCH) 1 468 334 565(BOSCH) 1 468 334 580(BOSCH) 1 468 334 590(BOSCH) 1 468 334 596(BOSCH) 1 468 334 603(BOSCH) 1 468 334 604(BOSCH) 1 468 334 666(BOSCH) 1 468 334 675(BOSCH) 1 468 334 837(BOSCH) 1 468 334 874(BOSCH) 1 468 334 899(BOSCH) 2 468 335 022(BOSCH) 1 468 336 371(BOSCH) 1 468 336 418(BOSCH) 1 468 336 528(BOSCH) 1 468 336 464(BOSCH) 1 468 336 480(BOSCH) 2 468 336 013(BOSCH) 1 468 336 614(BOSCH) 146400-8821(zexel) 146402-4020(zexel) VE distributor head: 3-cyl:USD:45/1pcs 4-cyl:USD:45/1pcs 5-cyl:USD:50/1pcs 6-cyl:USD:50/1pcs Minimum order is 48pcs a model. We also can make to order for other models as required. We use precision forging technology to create our products and surface treat them using an imported shot-blasting machine. The constant grinding process guarantees identical clearance in each plunger. Because we have been in the field of diesel fuel injection systems for quite a few years, we are acquainted with many domestic manufacturers of, and sales agents for, parts such as injector nozzles, plungers, delivery valves and so on. If you are interested in our products, please contact me. Thank you for your interest in our company. C.Hua Sales & purchasing director HTTP://WWW.China-LuTong.COM c.h@china-lutong.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From sthoenna at efn.org Sun Mar 3 12:24:31 2002 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: Re: Using mkpath References: <00a801c1c0a2$303a5a10$2088ddd1@aciwin> <8/wf8gzkgC6a092yn@efn.org> <014701c1c132$3a75f8a0$2088ddd1@aciwin> <20020301101556.B18535@hobart.helvella.org> <017301c1c153$4a09d810$2088ddd1@aciwin> <20020301114353.B18677@hobart.helvella.org> <20+f8gzkgKSU092yn@efn.org> <001201c1c189$12e32180$1a88ddd1@aciwin> Message-ID: In article <001201c1c189$12e32180$1a88ddd1@aciwin>, "Richard Anderson" wrote: >Well, we've probably beaten this to death, but since you mentioned it the >File::Path::mkpath documentation is NOT accurate. The documentation says >"It [mkpath] returns a list of all directories ... created." In fact, if >mkpath encounters a permissions problem, etc. it does NOT return a list of >directories, it throws a runtime error and the calling routine never gets >the list of directories. Fair enough. (Though it seems to me that would only happen with a disk filling up between making paths--or as a race condition). >I'm indulging in whining here, but I can't help but observe that the >implementation of mkpath goes against common sense. The authors compounded >their error by documenting the module incorrectly. Depends. The throw-exception model of error reporting is not one I prefer, but that's a matter of taste. I *think* mkpath originated for installing perl and modules. In that case, croaking on errors is an appropriate response. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From sthoenna at efn.org Sun Mar 3 12:37:21 2002 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: Re: Using mkpath In-Reply-To: <20020301114353.B18677@hobart.helvella.org> References: <00a801c1c0a2$303a5a10$2088ddd1@aciwin> <8/wf8gzkgC6a092yn@efn.org> <014701c1c132$3a75f8a0$2088ddd1@aciwin> <20020301101556.B18535@hobart.helvella.org> <017301c1c153$4a09d810$2088ddd1@aciwin> <20020301114353.B18677@hobart.helvella.org> Message-ID: In article <20020301114353.B18677@hobart.helvella.org>, you wrote: >I've mailed a patch of a suggested documentation change to Tim Bunce and >Charles Bailey, authors of File::Path. > >Unfortunately, this is a core module and it is very unlikely that it >will be updated from the CPAN on most Perl installations. Maybe they'll >change the docs in time for shipping with 5.8.0. As an aside, Ingy's >NAPC concept will help address the staticness of core modules. File::Path seems to only be in the core, not separately available on CPAN. Try sending your patch to perl5-porters@perl.org. 5.7.3 is supposed to come out tomorrow, with release candidates for 5.8.0 following several weeks later. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From johnl at johnlabovitz.com Sun Mar 3 19:29:34 2002 From: johnl at johnlabovitz.com (John Labovitz) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: Re: Using mkpath In-Reply-To: Message-ID: On 3/3/02 10:24 AM, "Yitzchak Scott-Thoennes" wrote: > In article <001201c1c189$12e32180$1a88ddd1@aciwin>, > "Richard Anderson" wrote: >> In fact, if >> mkpath encounters a permissions problem, etc. it does NOT return a list of >> directories, it throws a runtime error and the calling routine never gets >> the list of directories. > > Fair enough. (Though it seems to me that would only happen with a disk > filling up between making paths--or as a race condition). It also croaks if the directories already exist -- a fairly common situation. -- John Labovitz johnl@johnlabovitz.com www.johnlabovitz.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jeremy at weezel.com Sun Mar 3 20:57:57 2002 From: jeremy at weezel.com (Jeremy Devenport) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: Re: Using mkpath In-Reply-To: Message-ID: <000001c1c328$6857d7a0$1401a8c0@jeremydhome> BZZZT! Wrong. The snippet below is the only part of File::Path (the 5.6.1 version) that calls croak. Notice that it specifically doesn't croak if the directory exists, it's even commented. The documentation also doesn't say that it croaks if the directory exists. And I just ran a test and it didn't croak. unless (mkdir($path,$mode)) { my $e = $!; # allow for another process to have created it meanwhile croak "mkdir $path: $e" unless -d $path; } It even skips trying to make the directory in the first place if it already exists a few lines farther up, the unless -d $path just handles TOCTOU race conditions. I don't understand why there is so much confusion on this list about this module. Sure the documentation is incomplete but it's only about 35 lines of code. perldoc -m File::Path will bring up the code in a hurry if you don't want to go looking for it. Jeremy -----Original Message----- From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org] On Behalf Of John Labovitz Sent: Sunday, March 03, 2002 5:30 PM To: Yitzchak Scott-Thoennes; spug-list@pm.org Cc: richard@richard-anderson.org Subject: Re: SPUG: Re: Using mkpath On 3/3/02 10:24 AM, "Yitzchak Scott-Thoennes" wrote: > In article <001201c1c189$12e32180$1a88ddd1@aciwin>, > "Richard Anderson" wrote: >> In fact, if >> mkpath encounters a permissions problem, etc. it does NOT return a >> list of directories, it throws a runtime error and the calling >> routine never gets the list of directories. > > Fair enough. (Though it seems to me that would only happen with a > disk filling up between making paths--or as a race condition). It also croaks if the directories already exist -- a fairly common situation. -- John Labovitz johnl@johnlabovitz.com www.johnlabovitz.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From andrew at sweger.net Mon Mar 4 02:36:35 2002 From: andrew at sweger.net (Andrew Sweger) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: Re: Using mkpath In-Reply-To: <000001c1c328$6857d7a0$1401a8c0@jeremydhome> Message-ID: Ahem. That's like saying Microsoft makes trustworthy software. :) Documentation should accurately document what it documents. It can be vague, it can be concise, it can be silly. But it better not be inaccurate. So there! ;) On Sun, 3 Mar 2002, Jeremy Devenport wrote: > I don't understand why there is so much confusion on this list about > this module. Sure the documentation is incomplete but it's only about 35 > lines of code. perldoc -m File::Path will bring up the code in a hurry > if you don't want to go looking for it. -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From david.corcoran at Boeing.COM Mon Mar 4 09:40:41 2002 From: david.corcoran at Boeing.COM (EXT-Corcoran, David) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: Head & Rotor VE(CHINA-LuTong) 03/02 Message-ID: <58B6DA1B98AA9149B13B029976A48BCC088F5821@xch-nw-31.nw.nos.boeing.com> Great, gimme two... Sorry, only one tub per customer. > -----Original Message----- > From: china-lutong [mailto:c8h@cmmail.com] > Sent: Saturday, March 02, 2002 9:26 AM > To: spug-list@pm.org > Subject: SPUG: Head & Rotor VE(CHINA-LuTong) 03/02 > Importance: High > > > Dear Sir, > My name is ChenHua, and I'm writing on behalf of the > China-Lutong mechanical company. Located in the south east > of China, we specialize in hydraulic heads for the VE > distributor pump. > > We can supply standard, good quality units at a very > competitive price. The following types are available: > Engine model VE PUMS code NO UNIT PRICE(EX WORKS) > ISUZU) NP-VE4/11L 096400-1600 $USD40 > (NIPPON DENSO) > ISUZU NP-VE4/11R 146402-0820(zexel) $USD45 > ISUZU NP-VE4/11L 146402-0920(zexel) $USD40 > ISUZU NP-VE4/11L 146402-3820(zexel) $USD45 > NISSAN NP-VE4/12R 146402-4320(zexel) $USD50 > IVECO NP-VE4/11R 1 468 334 798(BOSCH) $USD45 > CUMMINS NP-VE6/12R 1 468 336 423(BOSCH) $USD50 > > In addition,the following models have been produced by > us,but there is no stock at present. > 096400-1240 > (NIPPON DENSO) > 1 468 333 320(BOSCH) > 1 468 333 323(BOSCH) > 2 468 334 021(BOSCH) > 2 468 334 050(BOSCH) > 1 468 334 313(BOSCH) > 1 468 334 565(BOSCH) > 1 468 334 580(BOSCH) > 1 468 334 590(BOSCH) > 1 468 334 596(BOSCH) > 1 468 334 603(BOSCH) > 1 468 334 604(BOSCH) > 1 468 334 666(BOSCH) > 1 468 334 675(BOSCH) > 1 468 334 837(BOSCH) > 1 468 334 874(BOSCH) > 1 468 334 899(BOSCH) > 2 468 335 022(BOSCH) > 1 468 336 371(BOSCH) > 1 468 336 418(BOSCH) > 1 468 336 528(BOSCH) > 1 468 336 464(BOSCH) > 1 468 336 480(BOSCH) > 2 468 336 013(BOSCH) > 1 468 336 614(BOSCH) > 146400-8821(zexel) > 146402-4020(zexel) > > VE distributor head: > 3-cyl:USD:45/1pcs > 4-cyl:USD:45/1pcs > 5-cyl:USD:50/1pcs > 6-cyl:USD:50/1pcs > Minimum order is 48pcs a model. > > > We also can make to order for other models as required. > > We use precision forging technology to create our products > and surface treat them using an imported shot-blasting machine. > The constant grinding process guarantees identical clearance > in each plunger. > > Because we have been in the field of diesel fuel injection > systems for quite a few years, we are acquainted with many > domestic manufacturers of, and sales agents for, parts such as > injector nozzles, plungers, delivery valves and so on. > > If you are interested in our products, please contact me. Thank > you for your interest in our company. > > > > C.Hua > Sales & purchasing director > > HTTP://WWW.China-LuTong.COM > c.h@china-lutong.com > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your > Email-address > For daily traffic, use spug-list for LIST ; for weekly, > spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From dragon at dreamhaven.net Wed Mar 6 12:39:12 2002 From: dragon at dreamhaven.net (Mikel Tidwell) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: Web interface problem Message-ID: Hi everyone, I'm stumped on how to proceed on a page for a web interface I'm creating for my web site. I want to be able to download a typically large file off another web server, and store it on the local server. By large, I mean an average of 20 MB or so, but up to 100 MB at a typical rate of 30K/s. Here's how I expect it to work: * User locates the file on another site, comes to the interface, and commands the file be downloaded. * Script uses either LWP or `wget` to fetch file. * Script moves on to allow the person how to name the file, etc. Problem: Downloading a file usually takes more than two minutes. If the client doesn't time out by then, the web server will terminate the process anyway (cgi time limit in Roxen). I could simply change this limit, but I'm looking for a smarter solution. I thought about creating a child process, but I know very little about fork(), or what happens to the parent in this scenario. I also have an issue with, should the child be able to download the file, notifying the user that the download was complete, so he/she can continue. If this still makes any sense, please help. Thanks... ^^ _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ -- Mikel Tidwell President: RPGamer -- http://www.rpgamer.com/ MSNM: FireMyst Personal Home Page -- http://dragon.rpgamer.com/ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From daryn at marinated.org Wed Mar 6 13:26:49 2002 From: daryn at marinated.org (Daryn Nakhuda) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: Web interface problem In-Reply-To: Message-ID: I'd love to hear a good way to do this as well.. Fork seemed to keep the little globe spinning in IE, but maybe I was doing it wrong. My hack to make it seem okay to the end user was just to schedule an at job (+10 seconds) from the cgi, then tell them it was being processed. I then had another place where you could check the status of jobs (the script being run by at updated the database as it ran). On Wed, 6 Mar 2002, Mikel Tidwell wrote: > Hi everyone, > > I'm stumped on how to proceed on a page for a web interface I'm creating > for my web site. I want to be able to download a typically large file off > another web server, and store it on the local server. By large, I mean an > average of 20 MB or so, but up to 100 MB at a typical rate of 30K/s. > > Here's how I expect it to work: > > * User locates the file on another site, comes to the interface, and > commands the file be downloaded. > * Script uses either LWP or `wget` to fetch file. > * Script moves on to allow the person how to name the file, etc. > > Problem: Downloading a file usually takes more than two minutes. If the > client doesn't time out by then, the web server will terminate the process > anyway (cgi time limit in Roxen). I could simply change this limit, but > I'm looking for a smarter solution. > > I thought about creating a child process, but I know very little about > fork(), or what happens to the parent in this scenario. I also have an > issue with, should the child be able to download the file, notifying the > user that the download was complete, so he/she can continue. > > If this still makes any sense, please help. Thanks... ^^ > > _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ > -- Mikel Tidwell President: RPGamer -- http://www.rpgamer.com/ > MSNM: FireMyst Personal Home Page -- http://dragon.rpgamer.com/ > - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > > -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From Ryan.Parr at wwireless.com Wed Mar 6 14:01:51 2002 From: Ryan.Parr at wwireless.com (Parr, Ryan) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: Web interface problem Message-ID: <6D6F0541E2B1D411A75B0002A513016D0280028A@wacorpml03.wwireless.com> After the user hits submit you could send them to a page that refreshes every seconds or so, providing the user with a progress bar. Once the file is 100% downloaded simply take them to the next step. You will need to maintain a certain amount of state with the self-reloading CGI. For a progress bar: my $percent_complete = int($file_currentsize / $file_totalsize); print < HERE -- Ryan -----Original Message----- From: Mikel Tidwell [mailto:dragon@dreamhaven.net] Sent: Wednesday, March 06, 2002 11:39 AM To: spug-list@pm.org Subject: SPUG: Web interface problem Hi everyone, I'm stumped on how to proceed on a page for a web interface I'm creating for my web site. I want to be able to download a typically large file off another web server, and store it on the local server. By large, I mean an average of 20 MB or so, but up to 100 MB at a typical rate of 30K/s. Here's how I expect it to work: * User locates the file on another site, comes to the interface, and commands the file be downloaded. * Script uses either LWP or `wget` to fetch file. * Script moves on to allow the person how to name the file, etc. Problem: Downloading a file usually takes more than two minutes. If the client doesn't time out by then, the web server will terminate the process anyway (cgi time limit in Roxen). I could simply change this limit, but I'm looking for a smarter solution. I thought about creating a child process, but I know very little about fork(), or what happens to the parent in this scenario. I also have an issue with, should the child be able to download the file, notifying the user that the download was complete, so he/she can continue. If this still makes any sense, please help. Thanks... ^^ _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ -- Mikel Tidwell President: RPGamer -- http://www.rpgamer.com/ MSNM: FireMyst Personal Home Page -- http://dragon.rpgamer.com/ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jsl at blarg.net Wed Mar 6 14:26:39 2002 From: jsl at blarg.net (Jim Ludwig) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: Web interface problem Message-ID: When I've run into this problem in the past, I also could only find a reasonable solution by handing the task off to the OS as a batch job: system( "/usr/bin/at -q b -f " . $global{Command} . " now" ); -----Original Message----- Date: Wed, 6 Mar 2002 11:26:49 -0800 (PST) From: Daryn Nakhuda To: Mikel Tidwell cc: Subject: Re: SPUG: Web interface problem I'd love to hear a good way to do this as well.. Fork seemed to keep the little globe spinning in IE, but maybe I was doing it wrong. My hack to make it seem okay to the end user was just to schedule an at job (+10 seconds) from the cgi, then tell them it was being processed. I then had another place where you could check the status of jobs (the script being run by at updated the database as it ran). On Wed, 6 Mar 2002, Mikel Tidwell wrote: > Hi everyone, > > I'm stumped on how to proceed on a page for a web interface I'm creating > for my web site. I want to be able to download a typically large file off > another web server, and store it on the local server. By large, I mean an > average of 20 MB or so, but up to 100 MB at a typical rate of 30K/s. > > Here's how I expect it to work: > > * User locates the file on another site, comes to the interface, and > commands the file be downloaded. > * Script uses either LWP or `wget` to fetch file. > * Script moves on to allow the person how to name the file, etc. > > Problem: Downloading a file usually takes more than two minutes. If the > client doesn't time out by then, the web server will terminate the process > anyway (cgi time limit in Roxen). I could simply change this limit, but > I'm looking for a smarter solution. > > I thought about creating a child process, but I know very little about > fork(), or what happens to the parent in this scenario. I also have an > issue with, should the child be able to download the file, notifying the > user that the download was complete, so he/she can continue. > > If this still makes any sense, please help. Thanks... ^^ > > _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ > -- Mikel Tidwell President: RPGamer -- http://www.rpgamer.com/ > MSNM: FireMyst Personal Home Page -- http://dragon.rpgamer.com/ > - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > > -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From mathin at mathin.com Wed Mar 6 14:39:51 2002 From: mathin at mathin.com (Dan Ebert) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: Web interface problem In-Reply-To: Message-ID: You might try turning off buffering $| = 1; Then printing something back to the broswer before starting the download ... that might keep it from complaining about timing out. I haven't tested it, but it might work. Dan. ---------------------------------------------------------- Immigration is the sincerest form of flattery. - Unknown ---------------------------------------------------------- On Wed, 6 Mar 2002, Daryn Nakhuda wrote: > > I'd love to hear a good way to do this as well.. Fork seemed to keep the > little globe spinning in IE, but maybe I was doing it wrong. My hack to > make it seem okay to the end user was just to schedule an at job (+10 > seconds) from the cgi, then tell them it was being processed. I then had > another place where you could check the status of jobs (the script being > run by at updated the database as it ran). > > > > On Wed, 6 Mar 2002, Mikel Tidwell wrote: > > > Hi everyone, > > > > I'm stumped on how to proceed on a page for a web interface I'm creating > > for my web site. I want to be able to download a typically large file off > > another web server, and store it on the local server. By large, I mean an > > average of 20 MB or so, but up to 100 MB at a typical rate of 30K/s. > > > > Here's how I expect it to work: > > > > * User locates the file on another site, comes to the interface, and > > commands the file be downloaded. > > * Script uses either LWP or `wget` to fetch file. > > * Script moves on to allow the person how to name the file, etc. > > > > Problem: Downloading a file usually takes more than two minutes. If the > > client doesn't time out by then, the web server will terminate the process > > anyway (cgi time limit in Roxen). I could simply change this limit, but > > I'm looking for a smarter solution. > > > > I thought about creating a child process, but I know very little about > > fork(), or what happens to the parent in this scenario. I also have an > > issue with, should the child be able to download the file, notifying the > > user that the download was complete, so he/she can continue. > > > > If this still makes any sense, please help. Thanks... ^^ > > > > _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ > > -- Mikel Tidwell President: RPGamer -- http://www.rpgamer.com/ > > MSNM: FireMyst Personal Home Page -- http://dragon.rpgamer.com/ > > - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > > > > > > -- > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jsl at blarg.net Wed Mar 6 15:03:51 2002 From: jsl at blarg.net (Jim Ludwig) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: Web interface problem Message-ID: Additional note on this: system( "/usr/bin/at -q b -f " . $global{Command} . " now" ); $global{Command} is an on-the-fly constructed shell script or Perl script, saved out to a file. Where I've run into this, the processing which needs to occur inside that script could take anywhere from 10 seconds to 10 hours. So, for the problem in question, large downloads, one could capture an email address, say, and send an email out to the user, at the end of the on-the-fly script, once the download is complete. -----Original Message----- From: Jim Ludwig To: Seattle Perl Users Group Subject: Re: SPUG: Web interface problem When I've run into this problem in the past, I also could only find a reasonable solution by handing the task off to the OS as a batch job: system( "/usr/bin/at -q b -f " . $global{Command} . " now" ); -----Original Message----- Date: Wed, 6 Mar 2002 11:26:49 -0800 (PST) From: Daryn Nakhuda To: Mikel Tidwell cc: Subject: Re: SPUG: Web interface problem I'd love to hear a good way to do this as well.. Fork seemed to keep the little globe spinning in IE, but maybe I was doing it wrong. My hack to make it seem okay to the end user was just to schedule an at job (+10 seconds) from the cgi, then tell them it was being processed. I then had another place where you could check the status of jobs (the script being run by at updated the database as it ran). On Wed, 6 Mar 2002, Mikel Tidwell wrote: > Hi everyone, > > I'm stumped on how to proceed on a page for a web interface I'm creating > for my web site. I want to be able to download a typically large file off > another web server, and store it on the local server. By large, I mean an > average of 20 MB or so, but up to 100 MB at a typical rate of 30K/s. > > Here's how I expect it to work: > > * User locates the file on another site, comes to the interface, and > commands the file be downloaded. > * Script uses either LWP or `wget` to fetch file. > * Script moves on to allow the person how to name the file, etc. > > Problem: Downloading a file usually takes more than two minutes. If the > client doesn't time out by then, the web server will terminate the process > anyway (cgi time limit in Roxen). I could simply change this limit, but > I'm looking for a smarter solution. > > I thought about creating a child process, but I know very little about > fork(), or what happens to the parent in this scenario. I also have an > issue with, should the child be able to download the file, notifying the > user that the download was complete, so he/she can continue. > > If this still makes any sense, please help. Thanks... ^^ > > _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ > -- Mikel Tidwell President: RPGamer -- http://www.rpgamer.com/ > MSNM: FireMyst Personal Home Page -- http://dragon.rpgamer.com/ > - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From daryn at marinated.org Wed Mar 6 18:58:42 2002 From: daryn at marinated.org (Daryn Nakhuda) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: dynamic 'use lib' Message-ID: is there a way to do something along the lines of: $libdir = "/usr/local/foo"; use lib $libdir; use BAR; # which is in $libdir I get the following: Empty compile time value given to use lib - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From aaronp at amazon.com Wed Mar 6 19:20:07 2002 From: aaronp at amazon.com (Aaron Paul) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: dynamic 'use lib' References: Message-ID: <3C86C047.4007A81D@amazon.com> you could do $libdir = "/path/to/libs"; require = "$libdir/library.pl"; Daryn Nakhuda wrote: > is there a way to do something along the lines of: > > $libdir = "/usr/local/foo"; > use lib $libdir; > use BAR; # which is in $libdir > > I get the following: > Empty compile time value given to use lib > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From aaronp at amazon.com Wed Mar 6 19:23:54 2002 From: aaronp at amazon.com (Aaron Paul) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: dynamic 'use lib' References: <3C86C047.4007A81D@amazon.com> Message-ID: <3C86C12A.35FD585D@amazon.com> sorry, that's: my $libdir = "/path/to/libs"; require "$libdir/library.pl"; Aaron Paul wrote: > you could do > > $libdir = "/path/to/libs"; > require = "$libdir/library.pl"; > > Daryn Nakhuda wrote: > > > is there a way to do something along the lines of: > > > > $libdir = "/usr/local/foo"; > > use lib $libdir; > > use BAR; # which is in $libdir > > > > I get the following: > > Empty compile time value given to use lib > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From daryn at marinated.org Wed Mar 6 19:26:23 2002 From: daryn at marinated.org (Daryn Nakhuda) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: dynamic 'use lib' In-Reply-To: <3C86C047.4007A81D@amazon.com> Message-ID: yeah, i'm hoping to leave it as a 'use' though, so I don't have to go through and change the rest of the code (add qualifications to the calls, etc). i'm trying to make a more generic version of a pretty large application, and one of the things i wanted to genericize is the libpath. since use is compile-time, I didn't figure what I was trying would work, but was wondering if there might be any other way to accomplish the same thing.. thanks. On Wed, 6 Mar 2002, Aaron Paul wrote: > you could do > > $libdir = "/path/to/libs"; > require = "$libdir/library.pl"; > > Daryn Nakhuda wrote: > > > is there a way to do something along the lines of: > > > > $libdir = "/usr/local/foo"; > > use lib $libdir; > > use BAR; # which is in $libdir > > > > I get the following: > > Empty compile time value given to use lib > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From dean at ero.com Wed Mar 6 19:38:08 2002 From: dean at ero.com (Dean Hudson) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: dynamic 'use lib' In-Reply-To: <3C86C12A.35FD585D@amazon.com> References: <3C86C047.4007A81D@amazon.com> <3C86C12A.35FD585D@amazon.com> Message-ID: <20020307013807.GA5292@ero.com> On Wed, Mar 06, 2002 at 05:23:54PM -0800, Aaron Paul wrote: > > sorry, that's: > > my $libdir = "/path/to/libs"; > require "$libdir/library.pl"; Or even: my $lib = $ARGV[0] || "foo.pl"; require $lib if (-e $lib); dean. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From sthoenna at efn.org Wed Mar 6 19:35:14 2002 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: dynamic 'use lib' References: Message-ID: In article , Daryn Nakhuda wrote: > >is there a way to do something along the lines of: > >$libdir = "/usr/local/foo"; >use lib $libdir; >use BAR; # which is in $libdir > >I get the following: >Empty compile time value given to use lib BEGIN { $libdir = "/usr/local/foo"; } use lib $libdir; use BAR; BEGIN{} executes code at compile time, so you can't use anything in it that is only set at runtime. If you need to set it at runtime, you'll need to use require. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From scott at mail.dsab.rresearch.com Wed Mar 6 19:54:34 2002 From: scott at mail.dsab.rresearch.com (Scott Blachowicz) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: dynamic 'use lib' In-Reply-To: ; from daryn@marinated.org on Wed, Mar 06, 2002 at 04:58:42PM -0800 References: Message-ID: <20020306175434.A13745@sabami.seaslug.org> On Wed, Mar 06, 2002 at 04:58:42PM -0800, Daryn Nakhuda wrote: > > is there a way to do something along the lines of: > > $libdir = "/usr/local/foo"; > use lib $libdir; > use BAR; # which is in $libdir > > I get the following: > Empty compile time value given to use lib My guess would be that 'use' is a compile time thing and that '$libdir' setting is a runtime thing. So, maybe something like this: BEGIN { $libdir = "/usr/local/foo"; use lib $libdir; use BAR; } would do the trick. Scott - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From dragon at dreamhaven.net Wed Mar 6 19:56:57 2002 From: dragon at dreamhaven.net (Mikel Tidwell) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: Web interface problem In-Reply-To: <6D6F0541E2B1D411A75B0002A513016D0280028C@wacorpml03.wwireless.com> Message-ID: Ryan, I'd like to say that I completely understand your script, but right now that's not the case. It's commented well, but I need to spend more time with it. I'm sure it'll be a big help. Thanks :> _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ -- Mikel Tidwell President: RPGamer -- http://www.rpgamer.com/ MSNM: FireMyst Personal Home Page -- http://dragon.rpgamer.com/ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - On Wed, 6 Mar 2002, Parr, Ryan wrote: -> Ok, my last script was bad. Admittedly. It didn't show you how to fork it -> and make it work at all. My boy has gone down for his nap though and I've -> had a chance to clean this up. -> -> Replace all HTML with your own favorite HTML or calls to your favorite -> templating system... -> -> -- Ryan Parr -> -> "Those who make peaceful revolution impossible will make violent revolution -> inevitable." -- John F. Kennedy -> -> -> -> -----Original Message----- -> From: Parr, Ryan [mailto:Ryan.Parr@wwireless.com] -> Sent: Wednesday, March 06, 2002 12:02 PM -> To: 'Mikel Tidwell'; spug-list@pm.org -> Subject: RE: SPUG: Web interface problem -> -> -> After the user hits submit you could send them to a page that refreshes -> every seconds or so, providing the user with a progress bar. Once the file -> is 100% downloaded simply take them to the next step. You will need to -> maintain a certain amount of state with the self-reloading CGI. -> -> For a progress bar: -> -> my $percent_complete = int($file_currentsize / $file_totalsize); -> -> print < -> -> ->
->
-> HERE -> -> -- Ryan -> -> -> -----Original Message----- -> From: Mikel Tidwell [mailto:dragon@dreamhaven.net] -> Sent: Wednesday, March 06, 2002 11:39 AM -> To: spug-list@pm.org -> Subject: SPUG: Web interface problem -> -> -> Hi everyone, -> -> I'm stumped on how to proceed on a page for a web interface I'm creating for -> my web site. I want to be able to download a typically large file off -> another web server, and store it on the local server. By large, I mean an -> average of 20 MB or so, but up to 100 MB at a typical rate of 30K/s. -> -> Here's how I expect it to work: -> -> * User locates the file on another site, comes to the interface, and -> commands the file be downloaded. -> * Script uses either LWP or `wget` to fetch file. -> * Script moves on to allow the person how to name the file, etc. -> -> Problem: Downloading a file usually takes more than two minutes. If the -> client doesn't time out by then, the web server will terminate the process -> anyway (cgi time limit in Roxen). I could simply change this limit, but I'm -> looking for a smarter solution. -> -> I thought about creating a child process, but I know very little about -> fork(), or what happens to the parent in this scenario. I also have an -> issue with, should the child be able to download the file, notifying the -> user that the download was complete, so he/she can continue. -> -> If this still makes any sense, please help. Thanks... ^^ -> -> _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ -> -- Mikel Tidwell President: RPGamer -- http://www.rpgamer.com/ -> MSNM: FireMyst Personal Home Page -- http://dragon.rpgamer.com/ -> - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - -> -> -> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -> POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org -> Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL -> Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address -> For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest -> Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org -> -> -> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -> POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org -> Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL -> Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address -> For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest -> Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org -> -> -> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From sthoenna at efn.org Wed Mar 6 22:41:57 2002 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: dynamic 'use lib' References: <20020306175434.A13745@sabami.seaslug.org> Message-ID: In article <20020306175434.A13745@sabami.seaslug.org>, Scott Blachowicz wrote: > BEGIN { > $libdir = "/usr/local/foo"; > use lib $libdir; > use BAR; > } That is equivalent to the following: BEGIN { require lib; lib::->import($libdir); require BAR; BAR::->import(); $libdir = "/usr/local/foo"; } which is not quite good enough. $libdir= needs to be in a BEGIN of its own. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From vince.skahan at Boeing.COM Thu Mar 7 10:04:24 2002 From: vince.skahan at Boeing.COM (Skahan, Vince) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: dynamic 'use lib' Message-ID: <3FD1EDB46AD86B4FBED5FE7E1763E06503381217@XCH-SEA-16.nw.nos.boeing.com> # calculate our @INC path on the fly # using the FindBin module to figure out # where we're at, then look there with relative paths # (see Perl5 Camel, page 415 for discussion) use FindBin qw($RealBin); use lib "$RealBin/../lib"; use lib "$RealBin/../etc"; # minimum versions required use MyLibFromLib 2.15; use MyCfgFromEtc 2.16; -- ----------- vince.skahan@boeing.com ----------- Connexion by Boeing - Cabin Network -----Original Message----- From: Daryn Nakhuda [mailto:daryn@marinated.org] Sent: Wednesday, March 06, 2002 4:59 PM To: spug-list@pm.org Subject: SPUG: dynamic 'use lib' is there a way to do something along the lines of: $libdir = "/usr/local/foo"; use lib $libdir; use BAR; # which is in $libdir I get the following: Empty compile time value given to use lib - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From ced at carios2.ca.boeing.com Thu Mar 7 12:26:14 2002 From: ced at carios2.ca.boeing.com (ced@carios2.ca.boeing.com) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: dynamic 'use lib' Message-ID: <200203071826.KAA23284@carios2.ca.boeing.com> In article <20020306175434.A13745@sabami.seaslug.org>, Scott Blachowicz wrote: > BEGIN { > $libdir = "/usr/local/foo"; > use lib $libdir; > use BAR; > } >> That is equivalent to the following: >> BEGIN { >> require lib; >> lib::->import($libdir); >> require BAR; >> BAR::->import(); >> $libdir = "/usr/local/foo"; >> } >> which is not quite good enough. >> $libdir= needs to be in a BEGIN of its own. Thanks for clarifying this. I was thinking like Scott until "use lib $libdir" got a warning tag: "Empty compile time value given to use lib at ..." Rgds, -- Charles DeRykus - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From binde at terindell.com Thu Mar 7 15:46:00 2002 From: binde at terindell.com (Melissa D. Binde) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: Web interface problem In-Reply-To: ; from daryn@marinated.org on Wed, Mar 06, 2002 at 11:26:49AM -0800 References: Message-ID: <20020307164600.C28922@terindell.com> You need to close both standard out and standard error after printing your "this job is being processed message": close(STDOUT); close(STDERR); that tells the web server that it's okay to continue. Then fork twice to disassociate yourself from the parent process and set yourself up as the leader of a new process group: if (!defined($pid = fork)) { &error_and_exit ("Unable to fork: $!\n"); } elsif ($pid) { waitpid ($pid, 0); exit 0; } # # child. fork again. # if (!defined($pid = fork)) { &error_and_exit ("Unable to fork: $!\n"); exit 1; } elsif ($pid) { exit 0; } &POSIX::setsid(); My script can also be run from the command line (it behaves "correctly" based on whether it's being called in a CGI context or not), so the double forking and new process group may not be required for a web solution, I don't know. I'm sure someone here can answer, though. The resulting disassociated process then emails the user when it's done. Conversely, you can use a page that refreshes (simply the parent, in the first fork there) to show current status to the user ("Yes/No" for completion.) Twas brillig, on Wed Mar 06 at 11:26:49 AM, and Daryn Nakhuda burbled: > > I'd love to hear a good way to do this as well.. Fork seemed to keep the > little globe spinning in IE, but maybe I was doing it wrong. My hack to > make it seem okay to the end user was just to schedule an at job (+10 > seconds) from the cgi, then tell them it was being processed. I then had > another place where you could check the status of jobs (the script being > run by at updated the database as it ran). > > > > On Wed, 6 Mar 2002, Mikel Tidwell wrote: > > > Hi everyone, > > > > I'm stumped on how to proceed on a page for a web interface I'm creating > > for my web site. I want to be able to download a typically large file off > > another web server, and store it on the local server. By large, I mean an > > average of 20 MB or so, but up to 100 MB at a typical rate of 30K/s. > > > > Here's how I expect it to work: > > > > * User locates the file on another site, comes to the interface, and > > commands the file be downloaded. > > * Script uses either LWP or `wget` to fetch file. > > * Script moves on to allow the person how to name the file, etc. > > > > Problem: Downloading a file usually takes more than two minutes. If the > > client doesn't time out by then, the web server will terminate the process > > anyway (cgi time limit in Roxen). I could simply change this limit, but > > I'm looking for a smarter solution. > > > > I thought about creating a child process, but I know very little about > > fork(), or what happens to the parent in this scenario. I also have an > > issue with, should the child be able to download the file, notifying the > > user that the download was complete, so he/she can continue. > > > > If this still makes any sense, please help. Thanks... ^^ > > > > _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ > > -- Mikel Tidwell President: RPGamer -- http://www.rpgamer.com/ > > MSNM: FireMyst Personal Home Page -- http://dragon.rpgamer.com/ > > - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - _ - > > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > > > > > > -- > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > > -M. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From benjamin at dzhan.com Sun Mar 10 19:27:13 2002 From: benjamin at dzhan.com (Benjamin Franks) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: C question ;) Message-ID: <20020310172619.B61151-100000@crimea.dzhan.com> I know this is a perl list, but I've had such good success with my questions in the past, I though I'd throw out a C question. I'd like to tie a typdef struct { qshmid = shmget(ftok(server_root,2), 0, 0666); qptr = shmat(qshmid, NULL, 0); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From benjamin at dzhan.com Sun Mar 10 19:35:38 2002 From: benjamin at dzhan.com (Benjamin Franks) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: C question ;) Message-ID: <20020310172744.I61151-100000@crimea.dzhan.com> woops! I fat-fingered that email way too soon. sorry for the confusion. anyway, here should be a more complete question. ;) I know this is a perl list, but I've had such good success with my questions in the past, I though I'd throw out a C question. I'd like to tie an array of structures to shared memory. But I have questions about accessing the elements. So for a simple example, say I have: typdef struct { time_t a; time_t b; } my_struct; and I create a shared memory segment with size to store 1000 of these structs, as in: int shmid=shmget((ftok("blah/blah",1), 1000*sizeof(my_struct), IPC_CREAT | 0666); Then when I attach the shmid to a pointer, do I want to attach a pointer of the my_struct type, as in: my_struct *ptr; ptr=shmat(shmid,NULL,0); I guess that's where my confusion lies. Let's say I want to work on the 500th element of my shared memory array of my_struct's. How can I do it? Thanks, --Ben - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From agent at ibcine.tv Sun Mar 10 22:14:04 2002 From: agent at ibcine.tv (agent) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: [ą¤°í]łŞľľ ŔĚÁŚ ŔÎĹÍłÝ żľČ­°ü ťçŔĺ´ÔŔĚ ľÉźö ŔÖ˝Ŕ´Ď´Ů. Message-ID: <20020311042746.519934878B@mail1.panix.com> An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20020311/b38b90a7/attachment.htm From scott at mail.dsab.rresearch.com Sun Mar 10 23:28:23 2002 From: scott at mail.dsab.rresearch.com (Scott Blachowicz) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: C question ;) In-Reply-To: <20020310172744.I61151-100000@crimea.dzhan.com>; from benjamin@dzhan.com on Sun, Mar 10, 2002 at 05:35:38PM -0800 References: <20020310172744.I61151-100000@crimea.dzhan.com> Message-ID: <20020310212822.A54051@sabami.seaslug.org> On Sun, Mar 10, 2002 at 05:35:38PM -0800, Benjamin Franks wrote: > ... > int shmid=shmget((ftok("blah/blah",1), 1000*sizeof(my_struct), IPC_CREAT | 0666); > > Then when I attach the shmid to a pointer, do I want to attach a pointer > of the my_struct type, as in: > > my_struct *ptr; > ptr=shmat(shmid,NULL,0); > > I guess that's where my confusion lies. Let's say I want to work on the > 500th element of my shared memory array of my_struct's. How can I do it? Well...in C, an array name is kind of like a constant ptr and array indexing is just a form of pointer arithmetic, so once you have a pointer, you're in business. /* Set all of the elements to the current time. */ for (i = 0; i < 500; i++) ptr[i].a = ptr[i].b = time(NULL); /* All of these should be equivalent (unless I'm remembering wrong). */ (ptr+499)->a = 0; (*(ptr+499)).a = 0; ptr[499].a = 0; 499[ptr].a = 0; /* !! */ Is that what you wanted? -- Scott Blachowicz - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From sthoenna at efn.org Mon Mar 11 00:53:37 2002 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: C question ;) References: <20020310172744.I61151-100000@crimea.dzhan.com> <20020310212822.A54051@sabami.seaslug.org> Message-ID: In article <20020310212822.A54051@sabami.seaslug.org>, Scott Blachowicz wrote: > /* All of these should be equivalent (unless I'm remembering wrong). */ > (ptr+499)->a = 0; > (*(ptr+499)).a = 0; > ptr[499].a = 0; > 499[ptr].a = 0; /* !! */ Last one only works if sizeof *ptr == 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From Daniel.Pommert at verizonwireless.com Mon Mar 11 10:20:18 2002 From: Daniel.Pommert at verizonwireless.com (Pommert, Daniel) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: C question ;) Message-ID: <9B30436F511ED5118EDF0002A55C31800119D8A6@cairvexmb03.irvn.ca.vzwcorp.com> No. The first three will work irrespective of the size of the pointed to object. (The fourth may work also; I'm not sure.) Look at the C standard section 6.3.2.1. In the example it explicitly says, "Then i is adjusted according to the type of x. which conceptually entails multiplying i by the size of the object to which the pointer points, ..." -- Daniel Pommert -----Original Message----- From: sthoenna@efn.org [mailto:sthoenna@efn.org] Sent: Sunday, March 10, 2002 10:54 PM To: spug-list@pm.org Subject: Re: SPUG: C question ;) In article <20020310212822.A54051@sabami.seaslug.org>, Scott Blachowicz wrote: > /* All of these should be equivalent (unless I'm remembering wrong). */ > (ptr+499)->a = 0; > (*(ptr+499)).a = 0; > ptr[499].a = 0; > 499[ptr].a = 0; /* !! */ Last one only works if sizeof *ptr == 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From benjamin at dzhan.com Mon Mar 11 11:21:14 2002 From: benjamin at dzhan.com (Benjamin Franks) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: C question ;) In-Reply-To: <20020310212822.A54051@sabami.seaslug.org> Message-ID: <20020311091958.T62189-100000@crimea.dzhan.com> Yes, that's what I was essentially asking. I wanted to make sure that it was normal array/pointer stuff and nothing special had to be done because it was shared memory. Thanks for your help! --Ben On Sun, 10 Mar 2002, Scott Blachowicz wrote: > On Sun, Mar 10, 2002 at 05:35:38PM -0800, Benjamin Franks wrote: > > ... > > int shmid=shmget((ftok("blah/blah",1), 1000*sizeof(my_struct), IPC_CREAT | 0666); > > > > Then when I attach the shmid to a pointer, do I want to attach a pointer > > of the my_struct type, as in: > > > > my_struct *ptr; > > ptr=shmat(shmid,NULL,0); > > > > I guess that's where my confusion lies. Let's say I want to work on the > > 500th element of my shared memory array of my_struct's. How can I do it? > > Well...in C, an array name is kind of like a constant ptr and array indexing > is just a form of pointer arithmetic, so once you have a pointer, you're in > business. > > /* Set all of the elements to the current time. */ > for (i = 0; i < 500; i++) ptr[i].a = ptr[i].b = time(NULL); > > /* All of these should be equivalent (unless I'm remembering wrong). */ > (ptr+499)->a = 0; > (*(ptr+499)).a = 0; > ptr[499].a = 0; > 499[ptr].a = 0; /* !! */ > > Is that what you wanted? > -- > Scott Blachowicz > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From Daniel.Pommert at verizonwireless.com Mon Mar 11 11:23:31 2002 From: Daniel.Pommert at verizonwireless.com (Pommert, Daniel) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: C question ;) Message-ID: <9B30436F511ED5118EDF0002A55C31800119D8A7@cairvexmb03.irvn.ca.vzwcorp.com> Sorry. I didn't read the previous respondant's comments carefully enough. He, too was only concerned about the last one. -- Daniel -----Original Message----- From: Pommert, Daniel [mailto:Daniel.Pommert@verizonwireless.com] Sent: Monday, March 11, 2002 8:20 AM To: 'sthoenna@efn.org'; spug-list@pm.org Subject: RE: SPUG: C question ;) No. The first three will work irrespective of the size of the pointed to object. (The fourth may work also; I'm not sure.) Look at the C standard section 6.3.2.1. In the example it explicitly says, "Then i is adjusted according to the type of x. which conceptually entails multiplying i by the size of the object to which the pointer points, ..." -- Daniel Pommert -----Original Message----- From: sthoenna@efn.org [mailto:sthoenna@efn.org] Sent: Sunday, March 10, 2002 10:54 PM To: spug-list@pm.org Subject: Re: SPUG: C question ;) In article <20020310212822.A54051@sabami.seaslug.org>, Scott Blachowicz wrote: > /* All of these should be equivalent (unless I'm remembering wrong). */ > (ptr+499)->a = 0; > (*(ptr+499)).a = 0; > ptr[499].a = 0; > 499[ptr].a = 0; /* !! */ Last one only works if sizeof *ptr == 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From cmeyer at helvella.org Tue Mar 12 02:14:51 2002 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: March Meeting Message-ID: <20020312001451.B13905@hobart.helvella.org> March 2002 Seattle Perl User's Group Meeting ------------------------------------------------------ Title: Relational Databases and XML: using the DBI with SAX Speaker: Colin Meyer, Helvella Time: Tuesday, March 19, 2002 7-9pm Location: SAFECO bldg, Brooklyn St. and NE 45th St. Cost: Admission is free and open to the general public. Info: http://seattleperl.org/ Topics: . Overview of XML and its uses . Processing XML with SAX . Writing a SAX handler to extract data from XML for insertion into an RDB . Writing a SAX driver to extract data from an RDB and generate XML Attendees who have not seen my introductory DBI talk, or are not familiar with the Perl Database Interface are encouraged to review: http://helvella.org/intro_dbi/ perldoc DBI This talk is a preview of some of the material in my "Database Programming with Perl" training course. There will be a public offering of this course from 4/22 to 4/25. For details, see: http://teachmeperl.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From benjamin at dzhan.com Tue Mar 12 12:46:44 2002 From: benjamin at dzhan.com (Benjamin Franks) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: sysv shared memory and forking Message-ID: <20020312103529.R64259-100000@crimea.dzhan.com> Let's say I have a parent process that creates and attaches a pointer to a shared memory segment and then forks off a number of children. I understand the children will inherit the parent's address space (copy on write and all that) and thus the pointer attached to the shared memory segment. However, do they inherit the entire memory segment as well? Or is the sysv memory segment created outside the parent processes address space to begin with? Thanks, --Ben - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From Ryan.Parr at wwireless.com Wed Mar 13 21:58:47 2002 From: Ryan.Parr at wwireless.com (Parr, Ryan) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: h2xs and the easy life Message-ID: <6D6F0541E2B1D411A75B0002A513016D028002D5@wacorpml03.wwireless.com> I'm trying to use h2xs for the first time on an HP-UX machine. I'm trying to convert into a perl mod. How nice would it be if I didn't have to write that module, and better yet didn't have to shell out! At least, that was the train of thought that got me here. Command run: h2xs -n FileSystem::Mount /usr/include/sys/mount.h Everything is created, make runs just fine, make install no probs. I can't use it though. When I load it (it loads fine) and call mount('/dev/vg00/lvtest1','/test1') function I get: Argument "/dev/vg00/lvtest1" isn't numeric in subroutine entry at /opt/perl5/lib/site_perl/5.6.1/PA-RISC1.1/FileSystem/Mount.pm line 133, line 2. Can't locate auto/FileSystem/Mount/mount.al in @INC (@INC contains: /opt/perl5/lib/5.6.1/PA-RISC1.1 /opt/perl5/lib/5.6.1 /opt/perl5/lib/site_perl/5.6.1/PA-RISC1.1 /opt/perl5/lib/site_perl/5.6.1 /opt/perl5/lib/site_perl .) at ./mount_test.pl line 12 Obviously not what I'm looking for. Argument 1 to the mount() function isn't supposed to be numeric: >From mount(2) -- SYNOPSIS #include int mount(const char *fs, const char *path, int mflag); int mount(const char *fs, const char *path, int mflag, const char *fstype, const char *dataptr, int datalen); New to XS, no real C background. Anyone see any blaring mistakes? -- Ryan Parr "Those who make peaceful revolution impossible will make violent revolution inevitable." -- John F. Kennedy -----Original Message----- From: Benjamin Franks [mailto:benjamin@dzhan.com] Sent: Tuesday, March 12, 2002 10:47 AM To: spug-list@pm.org Subject: SPUG: sysv shared memory and forking Let's say I have a parent process that creates and attaches a pointer to a shared memory segment and then forks off a number of children. I understand the children will inherit the parent's address space (copy on write and all that) and thus the pointer attached to the shared memory segment. However, do they inherit the entire memory segment as well? Or is the sysv memory segment created outside the parent processes address space to begin with? Thanks, --Ben - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jejuss16 at hanmir.com Thu Mar 14 02:40:04 2002 From: jejuss16 at hanmir.com (šĚÁř) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: źşŔÎÄÁĹŮĂ÷-Ŕý´ë.... Message-ID: <200203140848.g2E8mPO22036@mail.pm.org> An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20020314/274e022e/attachment.htm From sweetsue at sweethomes.com Thu Mar 14 10:05:29 2002 From: sweetsue at sweethomes.com (S Bullo) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: How to use database variable in place of other variable Message-ID: Ok, so the subject makes little sense. I have: %mail = ( To => '$email', >From => 'someemail@someplace.com', Subject => 'Your $row[10] Mailing Information', Message => "Some message information" ); sendmail(%mail) or die $Mail::Sendmail::error; print "OK. Log says:\n", $Mail::Sendmail::log; The script this is in also uses DBI to pull out some variables to include individual emails. Normally, in the script I use something like: my $email = "$row[12]"; But this doesn't plug into the $email variable (as the script keeps failing saying "No recipient"). How do I get the script to recognize the database variables (which rotate through a whole list)? TIA! Susanne Bullo Technician - One Site Marketing -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20020314/32bc7bda/attachment.htm From james at banshee.com Thu Mar 14 10:26:39 2002 From: james at banshee.com (James Moore) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: How to use database variable in place of other variable In-Reply-To: Message-ID: <001301c1cb75$055f5330$797ba8c0@gealach> First off, you're setting $mail{To} to $email - that's dollar sign email. You probably want to set it to the contents of the email variable, so just leave off the ': To => $email instead of To => '$email'. You could do To => "$email", but there's no reason to in this case. ???? ------------------------------------------------------------ ??????????????????????????? James M. Moore ????????????????????????? james@banshee.com ?????? Banshee Software: Internet-enabled software development ??????????????????? Open Source / .NET / Embedded -----Original Message----- From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org] On Behalf Of S Bullo Sent: Thursday, March 14, 2002 8:05 AM To: Seattle Perl User's Group Subject: SPUG: How to use database variable in place of other variable Ok, so the subject makes little sense. ? I have: ? %mail = ( To????? => '$email', From??? => 'someemail@someplace.com', Subject => 'Your $row[10] Mailing Information', Message => "Some message information" ?); sendmail(%mail) or die $Mail::Sendmail::error; print "OK. Log says:\n", $Mail::Sendmail::log; ? The script this is in also uses DBI to pull out some variables to include individual emails.? Normally, in the script I use something like: ? my $email = "$row[12]"; ? But this doesn't plug into the $email variable (as the script keeps failing saying "No recipient").? How do I get the script to recognize the database variables (which rotate through a whole list)? ? TIA! ? Susanne Bullo Technician - One Site Marketing ? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From sweetsue at sweethomes.com Thu Mar 14 10:43:40 2002 From: sweetsue at sweethomes.com (S Bullo) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: Would like to give back Message-ID: I've received so much super information from this list, I felt compelled to "give back". Through a website of mine, a request was made for a very specific program. Details: Wondering what you'd charge me for a cgi script that does the same job as Will Bontrager's MASTER SUBSCRIBER PRO i.e. enable users to click on one or more checkboxes for different ezines, then fill in their name and email address and click submit, which sends email to all checked box locations. Master Subscriber Pro is here http://willmaster.com/master/subscriberpro/index.shtml I would require rights to be able to use this script in a HTML course that I teach my class in Computing Studies (topic "Ways to enhance your site with CGI"). If you are interested, please contact me personally and I'll refer you to this gentleman. Thank you so much! Susanne Bullo Technician - One Site Marketing -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20020314/d8516d02/attachment.htm From tuck at whistlingfish.net Thu Mar 14 14:10:18 2002 From: tuck at whistlingfish.net (Matt Tucker) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: How to use database variable in place of other variable In-Reply-To: <001301c1cb75$055f5330$797ba8c0@gealach> References: <001301c1cb75$055f5330$797ba8c0@gealach> Message-ID: <200560000.1016136618@benzene.cobaltgroup.com> -- James Moore spake thusly: > First off, you're setting $mail{To} to $email - that's dollar sign > email. You probably want to set it to the contents of the email > variable, so just leave off the ': To => $email instead of To => > '$email'. You could do > To => "$email", but there's no reason to in this case. Another example of this is in: Subject => 'Your $row[10] Mailing Information', This should be in double-quotes. So that $row[10] is interpolated into the string. Another comment I had was on the sample code: my $email = "$row[12]"; I see this sort of thing done frequently, and I consider it bad style. I'm not sure how much extra work it creates for Perl (probably just a string copy, and maybe it's optimized out), but there's really no point in including those double quotes, since you'll get exactly the same thing without them. In this particular example, you could even do: %mail = ( To????? => $row[12], From??? => 'someemail@someplace.com', Subject => "Your $row[10] Mailing Information", Message => "Some message information" ?); and dispense with the $email variable entirely. Some people would prefer keeping it, since it makes the script more readable. I actually prefer to do fetchrow_arrayref(), since that makes the script even more readable: %mail = ( To????? => $row->{email}, From??? => 'someemail@someplace.com', Subject => "Your $row->{info} Mailing Information", Message => "Some message information" ?); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From asimjalis at yahoo.com Thu Mar 14 15:46:59 2002 From: asimjalis at yahoo.com (Asim Jalis) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: Seattle Extreme Programming Meeting Today: System Metaphor Message-ID: <20020314214659.98397.qmail@web14202.mail.yahoo.com> Just a reminder about the meeting today. We are meeting at 6.30 pm to have a FISHBOWL discussion about the SYSTEM METAPHOR Extreme Programming practice. We'll meet at Lante as always. DIRECTIONS http://www.seattlexp.com?SeattleXpMeetings SYSTEM METAPHOR WAR STORIES We will talk about successful applications of inventing and using the system metaphor. I have two examples from my team where we have come up with system metaphors that helped us name classes and methods. Bring your experiences, both negative and positive. SYSTEM METAPHOR WORKSHOP If you don't have a system metaphor for your current project the group can help you come up with one. You can explain your system to the group and we'll see if we can come up with a metaphor for you. __________________________________________________ Do You Yahoo!? Yahoo! Sports - live college hoops coverage http://sports.yahoo.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From benjamin at dzhan.com Thu Mar 14 16:47:37 2002 From: benjamin at dzhan.com (Benjamin Franks) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: NDBM questions Message-ID: <20020314143648.K68463-100000@crimea.dzhan.com> I have a small NDBM database that is normally written to by a C application. As the keys and values stored in an NDBM database are character strings, I'm casting ... something roughly like. struct custom_struct { some complex struct stuff; }; datum key, val; struct custom_struct aaa; key.dptr="bbb"; key.dsize=strlen(key.dptr); val.dptr=(char *) &aaa; val.dsize=sizeof(struct custom_struct); /* db is pointer to DBM already opened */ dbm_store(db, key, val, DBM_REPLACE); Now when I read the data from the database at a later time, I use memcpy to move from the stored string back to my struct, as in: val = dbm_fetch(db, key) memcpy((char *) &aaa, val.dptr, val.dsize); /* now work on struct aaa */ Ok, now for the question. I'm writing a Perl application that reads from the same database. However, if I tie a %hash to the ndbm file and then print out the keys and values, the values are garbled. Is there a Perl equivalent to the C memcpy for byte string copies? One more question. Let's say I open a handle to this database (or a file in general) in a parent and fork off children. The children inherit the open handle. Now, if the children close the handle explicitly, does that mean it closed for the parent as well? Or will the parent handle remain open? Thanks, --Ben - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From benjamin at dzhan.com Thu Mar 14 17:30:46 2002 From: benjamin at dzhan.com (Benjamin Franks) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: NDBM questions In-Reply-To: <20020314143648.K68463-100000@crimea.dzhan.com> Message-ID: <20020314152855.X68604-100000@crimea.dzhan.com> Just to clarify my earlier question....I'm not looking for a perl function for memcpy, but for a perl equivalent to my example use of memcpy which uses the cast. I think "unpack" may be what I want, but can't seem to get it right... thanks, --Ben On Thu, 14 Mar 2002, Benjamin Franks wrote: > > I have a small NDBM database that is normally written to by a C application. > As the keys and values stored in an NDBM database are character strings, > I'm casting ... something roughly like. > > struct custom_struct { > some complex struct stuff; > }; > > datum key, val; > struct custom_struct aaa; > > key.dptr="bbb"; > key.dsize=strlen(key.dptr); > > val.dptr=(char *) &aaa; > val.dsize=sizeof(struct custom_struct); > > /* db is pointer to DBM already opened */ > dbm_store(db, key, val, DBM_REPLACE); > > Now when I read the data from the database at a later time, I use memcpy > to move from the stored string back to my struct, as in: > > val = dbm_fetch(db, key) > memcpy((char *) &aaa, val.dptr, val.dsize); > /* now work on struct aaa */ > > Ok, now for the question. I'm writing a Perl application that reads from > the same database. However, if I tie a %hash to the ndbm file and then > print out the keys and values, the values are garbled. Is there a Perl > equivalent to the C memcpy for byte string copies? > > One more question. Let's say I open a handle to this database (or a file > in general) in a parent and fork off children. The children inherit the > open handle. Now, if the children close the handle explicitly, does that > mean it closed for the parent as well? Or will the parent handle remain > open? > > Thanks, > --Ben > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From cmeyer at helvella.org Thu Mar 14 18:16:23 2002 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:08:48 2004 Subject: SPUG: NDBM questions In-Reply-To: <20020314143648.K68463-100000@crimea.dzhan.com>; from benjamin@dzhan.com on Thu, Mar 14, 2002 at 02:47:37PM -0800 References: <20020314143648.K68463-100000@crimea.dzhan.com> Message-ID: <20020314161623.B20118@hobart.helvella.org> On Thu, Mar 14, 2002 at 02:47:37PM -0800, Benjamin Franks wrote: > > I have a small NDBM database that is normally written to by a C application. > As the keys and values stored in an NDBM database are character strings, > I'm casting ... something roughly like. > > struct custom_struct { > some complex struct stuff; > }; > > datum key, val; > struct custom_struct aaa; > > key.dptr="bbb"; > key.dsize=strlen(key.dptr); > > val.dptr=(char *) &aaa; > val.dsize=sizeof(struct custom_struct); > > /* db is pointer to DBM already opened */ > dbm_store(db, key, val, DBM_REPLACE); > > Now when I read the data from the database at a later time, I use memcpy > to move from the stored string back to my struct, as in: > > val = dbm_fetch(db, key) > memcpy((char *) &aaa, val.dptr, val.dsize); > /* now work on struct aaa */ > > Ok, now for the question. I'm writing a Perl application that reads from > the same database. However, if I tie a %hash to the ndbm file and then > print out the keys and values, the values are garbled. Is there a Perl > equivalent to the C memcpy for byte string copies? Perl doesn't grok C structs directly, so a memcpy in Perl doesn't make sense. You could attempt a scheme of digging into the struct with unpack(), but that would be difficult and probably not very portable. Another method would be to code a custom XS map so that Perl could understand your particular custom_struct. The problem here is the XS learning curve, which isn't entirely easy. I think that Inline::C is appropriate for your problem. You can use your same C code for accessing the NDBM file, and provide some "accessor" functions to be made visible to the Perl side. Take a look at the Inline::C-Cookbook manpage, and search for "Object Oriented Inline" for some example code. I think that this is very much what you are looking for. > > One more question. Let's say I open a handle to this database (or a file > in general) in a parent and fork off children. The children inherit the > open handle. Now, if the children close the handle explicitly, does that > mean it closed for the parent as well? Or will the parent handle remain > open? A child may close a filehandle, and the same filehandle remains open in the parent. Have fun, -C. > > Thanks, > --Ben > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From bjturner at mac.com Thu Mar 14 18:19:51 2002 From: bjturner at mac.com (Benjamin Turner) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: NDBM questions In-Reply-To: <20020314143648.K68463-100000@crimea.dzhan.com> Message-ID: <5DD0BCCA-37AA-11D6-B7D7-003065552952@mac.com> On Thursday, March 14, 2002, at 02:47 PM, Benjamin Franks wrote: > Ok, now for the question. I'm writing a Perl application that > reads from > the same database. However, if I tie a %hash to the ndbm file and then > print out the keys and values, the values are garbled. Is there a Perl > equivalent to the C memcpy for byte string copies? You'll need to use perl's 'unpack' function to translate from these C structures into something perlish. perldoc -f unpack will give you the lowdown, though there's a lot there and it'll probably take some fiddling. You may wish to separate the unpack part of the problem from the ndbm stuff and focus first on just unpacking the C structure from a flat file into perl. > One more question. Let's say I open a handle to this database > (or a file > in general) in a parent and fork off children. The children > inherit the > open handle. Now, if the children close the handle explicitly, > does that > mean it closed for the parent as well? Or will the parent > handle remain > open? The children have their own *copies* of the file descriptors, and when they close their *copies*, the parents' file descriptors are not affected. In other words, the parent's handle will still remain open. -- Benjamin John Turner | bjturner@bigfoot.com http://www.usfca.edu/turner/ | bjturner@mac.com "The happiest of people don't necessarily have the best of everything; they just make the most of everything that comes along their way." - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From benjamin at dzhan.com Thu Mar 14 18:45:00 2002 From: benjamin at dzhan.com (Benjamin Franks) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: unpack Message-ID: <20020314164020.G68808-100000@crimea.dzhan.com> Thanks for all the responses recommending unpack(). Here's an example I'm trying: struct alpha { char *a; long b; }; Now let's say the byte-string equivalent is stored in a file. I snag it into perl into $alpha; $len=length($alpha)-4; ($a,$b) = unpack("a$len l",$alpha); I get the 4-byte long value correctly. But the string for $a is garbled or empty. Any ideas, --Ben - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From ricardo_cardona at hotmail.com Fri Mar 15 00:20:33 2002 From: ricardo_cardona at hotmail.com (Ricardo Cardona) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Perl books collection Message-ID: An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20020315/ebb7e415/attachment.htm From dancerboy at strangelight.com Fri Mar 15 00:21:02 2002 From: dancerboy at strangelight.com (dancerboy) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: How to use database variable in place of other variable In-Reply-To: <200560000.1016136618@benzene.cobaltgroup.com> References: <001301c1cb75$055f5330$797ba8c0@gealach> <200560000.1016136618@benzene.cobaltgroup.com> Message-ID: At 12:10 PM -0800 3/14/02, Matt Tucker wrote: > >Another comment I had was on the sample code: > > my $email = "$row[12]"; > >I see this sort of thing done frequently, and I consider it bad style. >I'm not sure how much extra work it creates for Perl (probably just a >string copy, and maybe it's optimized out), but there's really no point >in including those double quotes, since you'll get exactly the same >thing without them. nitpick: I agree that this is bad style. However, it is not *strictly* true that "you'll get exactly the same thing without them". If $row[12] is undefined, then the semantics will be slightly different depending on whether you're interpolating into a double-quoted string or not. Consider this: undef @row; my $email_1 = $row[12]; my $email_2 = "$row[12]"; $email_1 will be undefined, but $email_2 will contain the empty string. There is, as most of you know, a difference. But again, I do agree that this is bad style. If your intent is to make sure that undef values get turned into empty strings, then you should do so more explicitly, e.g.: my $email = $row[12]; $email = '' unless defined $email; or perhaps: my $email = ( defined($row[12]) ? $row[12] : '' ); (And yes, I know that the parentheses in the above statement are unnecessary. But personally, one of my biggest pet peeves is developers who won't use extra parentheses to clarify their code. I consider the following to be atrocious style: my $email = defined $row[12] ? $row[12] : ''; IMO, you should always, in all but the most trivial and obvious of cases, use parentheses to make the order of operations explicit. Real developers have better things to do with their brain-cells than memorize operator precedence.) -jason - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From richard at richard-anderson.org Fri Mar 15 00:55:28 2002 From: richard at richard-anderson.org (Richard Anderson) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Re: unpack References: <20020314164020.G68808-100000@crimea.dzhan.com> Message-ID: <005c01c1cbee$79883870$1c88ddd1@aciwin> Not 100% certain, but it looks like you forgot to account for the null terminator on the string. $len=length($alpha)-4; gives you the length of the string + 1 for the null terminator. Try $len=length($alpha)-5. (Somewhat relevant aside: using hard-coded values for system-dependent values like the length of a long is not very portable. It's better to use a variable for magic numbers like this, and document what it represents. Even better, have your C code calculate this with the sizeof operator, write it to the data file and read this value for use by your Perl code.) Cheers, Richard richard@richard-anderson.org www.richard-anderson.org www.raycosoft.com ----- Original Message ----- From: "Benjamin Franks" To: Sent: Thursday, March 14, 2002 4:45 PM Subject: SPUG: unpack > Thanks for all the responses recommending unpack(). Here's an example > I'm trying: > > struct alpha { > char *a; > long b; > }; > > Now let's say the byte-string equivalent is stored in a file. I snag it > into perl into $alpha; > > $len=length($alpha)-4; > ($a,$b) = unpack("a$len l",$alpha); > > I get the 4-byte long value correctly. But the string for $a is > garbled or empty. > > Any ideas, > --Ben > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jope-spug at jope.net Fri Mar 15 02:18:25 2002 From: jope-spug at jope.net (El JoPe Magnifico) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: How to use database variable in place of other variable In-Reply-To: Message-ID: On Thu, 14 Mar 2002, dancerboy wrote: > But again, I do agree that this is bad style. If your intent is to > make sure that undef values get turned into empty strings, then you > should do so more explicitly, e.g.: > > my $email = $row[12]; > $email = '' unless defined $email; > > or perhaps: > > my $email = ( defined($row[12]) ? $row[12] : '' ); Heh, I can't wait til Perl 6, when we finally get a defined()-based version of the current "truth"-based short-circuiting operator "||": my $email = $row[12] \\ ''; Yeehaw! "Use of uninitialized value" warnings... begone! =) -jp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tuck at whistlingfish.net Fri Mar 15 02:43:50 2002 From: tuck at whistlingfish.net (Matt Tucker) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: RE: [OT] Precedence and parentheses [was: How to use database ...] In-Reply-To: References: <001301c1cb75$055f5330$797ba8c0@gealach> <200560000.1016136618@benzene.cobaltgroup.com> Message-ID: <93280000.1016181830@flashingchance.whistlingfish.net> -- dancerboy spake thusly: > At 12:10 PM -0800 3/14/02, Matt Tucker wrote: >> >> my $email = "$row[12]"; > > I agree that this is bad style. However, it is not *strictly* true > that "you'll get exactly the same thing without them" Good point. Thanks for the clarification. > my $email = ( defined($row[12]) ? $row[12] : '' ); > > (And yes, I know that the parentheses in the above statement are > unnecessary. But personally, one of my biggest pet peeves is > developers who won't use extra parentheses to clarify their code. I > consider the following to be atrocious style: > > my $email = defined $row[12] ? $row[12] : ''; > > IMO, you should always, in all but the most trivial and obvious of > cases, use parentheses to make the order of operations explicit. Real > developers have better things to do with their brain-cells than > memorize operator precedence.) While I certainly understand this viewpoint, my philosophy here is a bit different. I prefer to not use parentheses whenever possible because I feel it makes the code look cleaner and more readable. I figure that as long as the code does what it _looks_like_ it's supposed to do, parentheses are unnecessary. For instance, in the case of: if ($a == 'foo' or $b == 'bar') { it seems fairly clear to me, without the clutter of extra parentheses, what's intended here. In the case of: my $email = defined $row[12] ? $row[12] : ''; I also believe the intent is clear. Of course, if precendence doesn't support the intended results or if the intent is potentially unclear, then by all means throw them in. This is, of course, my style; I certainly wouldn't ask anyone else to follow it. And as for brain cells, I figure I can probably spare the few required to do this. ;-) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/spug-list/attachments/20020315/3d7f0db7/attachment.bin From ncstyle53 at hotmail.com Fri Mar 15 03:07:19 2002 From: ncstyle53 at hotmail.com (´şÄÚ˝ş) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: żŠźşşĐÁß Č­ŔĺÇ° ž˛˝Ă´Â şĐ¸¸ ş¸źźżä.ąŚÂúŔş ˝ÎŔĚĆŽ źŇ°łÇϡÁą¸żä.[ą¤ °í] Message-ID: <200203150909.g2F99HO25230@mail.pm.org> An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20020315/0bb89bab/attachment.htm From mark at lanfear.net Fri Mar 15 15:10:18 2002 From: mark at lanfear.net (Mark Wagner) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Re: spug-list-digest V1 #179 In-Reply-To: Your message of "Fri, 15 Mar 2002 02:08:33 CST." <200203150808.g2F88XL25086@mail.pm.org> Message-ID: <200203152110.g2FLAIF19455@freddy.lanfear.net> > I have a small NDBM database that is normally written to by a C application. > As the keys and values stored in an NDBM database are character strings, > I'm casting ... something roughly like. > > struct custom_struct { > some complex struct stuff; > }; > > datum key, val; > struct custom_struct aaa; > > key.dptr="bbb"; > key.dsize=strlen(key.dptr); > > val.dptr=(char *) &aaa; > val.dsize=sizeof(struct custom_struct); > > /* db is pointer to DBM already opened */ > dbm_store(db, key, val, DBM_REPLACE); > > Now when I read the data from the database at a later time, I use memcpy > to move from the stored string back to my struct, as in: > > val = dbm_fetch(db, key) > memcpy((char *) &aaa, val.dptr, val.dsize); > /* now work on struct aaa */ > > Ok, now for the question. I'm writing a Perl application that reads from > the same database. However, if I tie a %hash to the ndbm file and then > print out the keys and values, the values are garbled. Is there a Perl > equivalent to the C memcpy for byte string copies? You're playing with fire delving into C structs this way. Quoting from : [T]he elements of a struct are laid out in the order given in the declararation [sic] of the structure. The compiler is not allowed to reorder the elements, but it is allowed to insert padding between the elements, in order to make the access to the structure elements more efficient and to support machines that require data to be aligned. So you might be running into padding which you may be able to fix. Your code will be compiler- and machine-dependent but that may be okay for you and the the people that have to get the code to work on another machine. If you still can't get perl to grok them the next easiest option may be to write some XS code to call some C functions to extract the fields you need in perl. The long-term solution may be to write some C functions that store the structure in a string through a member-wise copy into it, recursing at each member struct so that the string is nothing but strings and atomic C data types. Handing that string with perl would be much easier: using unpack would be straightforward. Plus your C code could be compiled with different compilers. If you wanted to run on different architectures you would need to use the hton* functions to take care of endian issues. -- Mark Wagner mark@lanfear.net - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From dancerboy at strangelight.com Fri Mar 15 20:55:37 2002 From: dancerboy at strangelight.com (dancerboy) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: RE: Precedence and parentheses [was: How to use database ...] In-Reply-To: <93280000.1016181830@flashingchance.whistlingfish.net> References: <001301c1cb75$055f5330$797ba8c0@gealach> <200560000.1016136618@benzene.cobaltgroup.com> <93280000.1016181830@flashingchance.whistlingfish.net> Message-ID: At 12:43 AM -0800 3/15/02, Matt Tucker wrote: >-- dancerboy spake thusly: > >> At 12:10 PM -0800 3/14/02, Matt Tucker wrote: >>> >>> my $email = "$row[12]"; >> >> I agree that this is bad style. However, it is not *strictly* true >> that "you'll get exactly the same thing without them" > >Good point. Thanks for the clarification. > > > my $email = ( defined($row[12]) ? $row[12] : '' ); >> >> (And yes, I know that the parentheses in the above statement are >> unnecessary. But personally, one of my biggest pet peeves is >> developers who won't use extra parentheses to clarify their code. I >> consider the following to be atrocious style: >> > > my $email = defined $row[12] ? $row[12] : ''; >> >> IMO, you should always, in all but the most trivial and obvious of >> cases, use parentheses to make the order of operations explicit. Real >> developers have better things to do with their brain-cells than >> memorize operator precedence.) > >While I certainly understand this viewpoint, my philosophy here is a >bit different. I prefer to not use parentheses whenever possible >because I feel it makes the code look cleaner and more readable. I >figure that as long as the code does what it _looks_like_ it's supposed >to do, parentheses are unnecessary. Well, this example was probably a poor one, since a line like my $email = defined $row[12] ? $row[12] : ''; arguably qualifies as one of those "most trivial and obvious of cases". OTOH, when considering coding style, do remember this: often, when a developer is looking at someone else's code, it's because something isn't working the way it's supposed to. They're looking for bugs. When I see an expression like the one above, it may be obvious what the original developer *intended* -- but, depending on the context, I may still have a reasonable doubt about whether that statement is actually doing what the developer intended. Unless I have Perl's operator-precedence tables memorized, a line like this becomes one more *potential* coding error that I have to investigate. Does the above really do what it looks like it's doing? or is it perhaps being parsed like this: $email = defined( $row[12] ? $row[12] : '' ); ? or perhaps even like: ( $email = defined $row[12] ) ? $row[12] : ''; ? But if the original developer spells it out as $email = ( defined($row[12]) ? $row[12] : '' ); Then I know, without having to consult an operator-precedence table, that this line is at least doing what it looks like it's doing. It's one less thing that I have to worry about. Admittedly, I may have a somewhat biased view, since much of my work lately has involved sifting through reams of poorly-written, undocumented code created by developers who didn't know what the ${expletive} they were doing, and trying to figure out which of the tortuous, illegible constructions are actually coding errors, and which just look like it. :-/ And I agree that deeply-nested parens can easily make the code difficult to read. That's why I personally advocate indenting sub-expressions and aligning parens the same way you would curly-braces. E.g. in my own code I would actually write the above line as: $email = ( defined( $row[12] ) ? $row[12] : '' ); Someday I think I'm going to put together a "Jason Lamport Coding Style" style-guide (not in the spirit of "this is the best way to code and everyone should do it my way!" but more as a set of conventions that I personally have found helpful, and that others might find helpful as well)... -jason P.S. Why was this thread labeled "[OT]"? Seems to me discussions of coding style are perfectly on-topic for a Perl discussion list? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From ricardo_cardona at hotmail.com Sat Mar 16 10:16:25 2002 From: ricardo_cardona at hotmail.com (Ricardo Cardona) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Perl books have been sold Message-ID: An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20020316/24751fc1/attachment.htm From sthoenna at efn.org Sun Mar 17 03:37:54 2002 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Re: unpack References: <20020314164020.G68808-100000@crimea.dzhan.com> <005c01c1cbee$79883870$1c88ddd1@aciwin> Message-ID: In article <005c01c1cbee$79883870$1c88ddd1@aciwin>, "Richard Anderson" wrote: >Not 100% certain, but it looks like you forgot to account for the null >terminator on the string. $len=length($alpha)-4; gives you the length of >the string + 1 for the null terminator. Try $len=length($alpha)-5. > >(Somewhat relevant aside: using hard-coded values for system-dependent >values like the length of a long is not very portable. It's better to use a >variable for magic numbers like this, and document what it represents. Even >better, have your C code calculate this with the sizeof operator, write it >to the data file and read this value for use by your Perl code.) This is available in the %Config::Config hash: ~ $perl -MConfig -wle'print $Config{longsize}' 4 Also there are: ~ $perl -V:.*size charsize='1' d_chsize='undef' doublesize='8' fpossize='4' gidsize='2' i16size='2' i32size='4' i64size='8' i8size='1' intsize='4' ivsize='4' longdblsize='12' longlongsize='8' longsize='4' lseeksize='4' nvsize='8' ptrsize='4' shortsize='2' sizesize='4' u16size='2' u32size='4' u64size='8' u8size='1' uidsize='2' uvsize='4' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tim at consultix-inc.com Sun Mar 17 10:17:13 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: unpack Message-ID: <20020317081713.A7936@timji.consultix.wa.com> SPUGsters, pack() and unpack() are perhaps among the most generally useful, but inscrutable, of the Perl builtin functions. Many people should probably be using them where they aren't, but don't because of the cryptic interface, shortage of examples, and skimpy documentation. Sounds like an ideal topic for discussion at an upcoming SPUG meeting! Those interested in Volunteering, please get in touch with me. Also, those of you who have interesting examples of using pack() or unpack(), please post them to the list along with an explanation of what they do, so we can gain a better understanding of these functions. -Tim P.S. Upcoming Meetings: 3/19: Colin Meyer on "Relational Databases and XML" * A free copy of Colin's "Database Programming with Perl" training manual will be given away (http://teachmeperl.net/dbi.html) 4/16: Open 5/21: Open 6/18: Open 7/17: "An Evening with The Damain" 8/20: Open 9/17: Open 10/15: Open 11/19: Open 12/17: Open ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From chris at chriskate.net Sun Mar 17 15:00:34 2002 From: chris at chriskate.net (Chris Sutton) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: pack Message-ID: <200203172100.g2HL0ZC07813@phineas.chriskate.net> My use of pack/unpack I have some code that generates an html table formatted family tree. The whole thing works by giving each entry a number which will determine where they live in the table. There are two parts which determine where they go: 1. which generation they belong to ($g) 2. If they are male or female (1=male, 0=female). The number assigned to an entry doesn't make any sense unless it's looked at as a binary representation, which is what I use pack and unpack for. Lets say we start with me at the bottom of the tree at generation. I don't get a number because I know where I go, but my father would have a number of 1 which looks like this in binary because he is a male and my mother would have a number of 0. Generation 1 1 - father of chris (duh, really boring, but stick with me) 0 - mother of chris Next we look at the next generation in binary (generation 2) 11 - father of chris's father = 3 decimal 10 - mother of chris's father = 1 decimal 01 - father of chris's mother = 2 decimal 00 - mother of chris's mother = 0 decimal Next generation (generation 3) 111 - father of chris's fathers father = 7 decimal 110 - mother of chris's fathers father = 3 decimal 101 - father of chris's fathers mother = 5 decimal 100 = 1 decimal 011 = 6 decimal 010 = 2 decimal 001 = 4 decimal 000 = 0 decimal OK, how do I use pack? In order to get the decimal number, which I use in another place, I need to manipulate individual bits. $g = 3; # we are going to work on generation 3 $child = 2; # father of chris's mother (01 in binary) $t = 1; # means we want to get the number for the father of $child $b = pack("V",$child); # takes 2 decimal and makes it into a 32 bit binary number in "V" format and # which I think was reverse network order (left to right reading or something) # and this gives us something like 01000000000000000000000... vec($b,$g-1,1) = $t; # modifies the binary pack and sets bit 2 to 1 so our binary pack $b looks like 011000000000000000000000... $n = unpack("V",$b); # converts that binary back into decimal 6 This is probably a trival use of pack and unpack but it took me a while to figure out that I could even use pack and unpack to solve my problem which I think is what Tim was talking about. For those interested here is a link to what the tree actually looks like. http://www.chriskate.net/tree.pl?pid=1 The only links that really work to navigate are the [+]'s which move you around the tree. I'm working on the rest at the moment. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tim at consultix-inc.com Sun Mar 17 17:32:11 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Happy 4th Birthday, SPUG! Message-ID: <20020317153211.A13896@timji.consultix.wa.com> SPUGsters, Just a quick note to commemorate the fact that this group was born four years ago today, at a meeting at a community center in Ballard (a neighborhood of Seattle, WA, USA)! Where did the idea for SPUG come from? Well, while contemplating my existence atop a smoke-spewing volcano in Java, Indonesia a few weeks earlier, I had resolved to try to establish a local community to support those using this fantastic language. I wasn't sure if anybody would show up to that inaugural meeting, but as it happened, about two dozen gave up their inalienable rights as Americans to drink Green Beer and attended this meeting instead. There are hundreds of Perl groups now, but at the time, SPUG was only the *sixth* ever formed. (Incidentally, this is why we've retained the SPUG moniker, despite the fact that later groups came to be know by "Perl Monger" appellations.) Thanks to all those who've participated in making SPUG a success! In particular, please join me in thanking zipcon.net, our web-page sponsor, the folks at Safeco, who provide our meeting space, along with Andy Sweger and Dora Choi, who manage that resource, and Colin Meyer, who frequently helps wherever necessary to keep SPUG running smoothly. And, of course, Damian Conway ("The Damian"), who frequently ventures halfway across the globe to inspire and terrify us with his strangely deranged yet profound Perl musings. We've had over 50 meetings thus far, which have featured many of the most influential people in the Perl community, including Damian Conway, Marc Jason Dominus, Gisle Ais, Nathan Torkington, Brian Ingerson, and Randal Schwartz. Not to mention presentations by many local members, who have shared their Perl knowledge with us through long presentations, short presentations, and "lightning talks". For those of you who are interested in contributing to the group, there are many ways to do so. We are always looking for speakers for upcoming meetings who can teach us something about the Perl language or describe interesting Perl applications they've discovered or written, so if you'd like to make a presentation, get in touch with me. We're also always looking for volunteers to help with other tasks, like recruiting speakers, maintaining the web page, coordinating job-ads, setting up additional internet-based services, coordinating joint software development activities, etc. This is our group, and we can do whatever we want with it, so if anybody has suggestions about improvements, especially if you're willing to help implement them, let me know! And happy "SPUG-Patrick's" Day! ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tim at consultix-inc.com Sun Mar 17 18:15:33 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: backticks, system, and ImageMagick Message-ID: <20020317161533.D14282@timji.consultix.wa.com> (Forwarded after removal of spam-triggers) -Tim On Mon, Feb 25, 2002 at 12:14:57PM -0800, Richard Wood wrote: > I am a unix kind of guy trying to function in a win98 > situation. > > I am having a problem with backticks and I am looking > for new ideas on what it could be. > > I am running in a MSDOS window trying to execute some > ImageMagick commands from perl. The path to the > ImageMagick bin directory in included in my PATH > environment variable. I can issue all of the > ImageMagick commands from the command line (mogrify, > identify, composite, and montage and they all return > the usage for the command. When I write a very simple > script such as: Another approach to using ImageMagick tools from within Perl programs is to use the Image::Magick module. This provides a nice, object oriented interface to all of the functionallity of the ImageMagick library. Error conditions are available via return values of method calls instead of STDERR capturing trickery. For more info, see: http://www.simplesystems.org/ImageMagick/www/perl.html The installation section claims that you can install it on Win95, though I only have experience using it on Linux and Solaris systems. I seem to remember that installing it wasn't quite as straight forward as most modules, but don't recall the exact trouble. I think that it was getting a compatible version of the ImageMagick library installed. Have fun, -C. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tim at consultix-inc.com Sun Mar 17 18:17:08 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: backticks, system, and ImageMagick Message-ID: <20020317161708.E14282@timji.consultix.wa.com> (Forwarded after removal of SPAM-triggers) -Tim When in windoze I usually do something like this: open CMD,"program |" or die; while () { print; } Note, at least in w2k, that both stdout and stderr are read on the pipe, but you can use open CMD,"program 2>nul |" to suppress stderr (or stdout 1>nul). You may wanna try it on win98. --@@ ~ DavidC The Biggest Game In Town - http://www.wces.org/html_files/burien.html Finally, America will begin to see the staggering wealth our own city, county, state, and federal governments hold secret accounts. If these hidden assets - that the AMERICAN PEOPLE own - can be liberated from government agencies, we can see a virtual end to property and income tax. Sound impossible? Then you haven't heard Walter Burien exposing the Comprehensive Annual Financial Report (CAFR) scam. > -----Original Message----- > From: Richard Wood [mailto:wildwood_players@yahoo.com] > Sent: Monday, February 25, 2002 12:15 PM > To: Spug > Subject: SPUG: backticks, system, and ImageMagick > > > I am a unix kind of guy trying to function in a win98 > situation. > > I am having a problem with backticks and I am looking > for new ideas on what it could be. > > I am running in a MSDOS window trying to execute some > ImageMagick commands from perl. The path to the > ImageMagick bin directory in included in my PATH > environment variable. I can issue all of the > ImageMagick commands from the command line (mogrify, > identify, composite, and montage and they all return > the usage for the command. When I write a very simple > script such as: > > perl -e "print `mogrify`;" > > I get the usage only if I use mogrify, or convert. If > I try identify, composite, or montage, I get nothing. > > On the other hand, if I write: > > perl -e "system(montage);" > > it works and returns the usage for all of the > commands, but I guess I can't capture the output in an > array in my perl when I use system, right? > > I have tried using the full path to the executable and > it still doesn't work. > > Could some of the commands be writing to something > other than STDOUT? like STDERR? > > I would appreciate any ideas. > > > ===== > Richard O. Wood > Wildwood IT Consultants, Inc. > wildwood_players@yahoo.com > 425.941.9437 > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your > Email-address > For daily traffic, use spug-list for LIST ; for weekly, > spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tim at consultix-inc.com Sun Mar 17 18:18:19 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: backticks, system, and ImageMagick Message-ID: <20020317161819.F14282@timji.consultix.wa.com> (Forwarded after spam-laundering) -Tim I suspected that STDERR might be the culprit, but then as you say, I should still be seeing the output in the dos shell. Bob Brockhausen wrote: > What I did was to put the entire command & > the file redirect inside the call to "system" > and return code is assigned to local scalar. > If scalar > 0 then it was good else not good... > > $var = sysetm("/usr/sbin/ping $host 128 10 > >/dev/null"); > if ($ var != 0) { #enter more processing to do since > I can't ping $host > hopefully this will work for you If I understand > your problem.... However what I need to do is capture the output from the command. Specifically, I am trying to run: identify picture.jpg which returns: picture.jpg JPEG 312x135 DirectClass 8-bit 17235b 0.1u 0:01 This gives me the geometry of the graphic so that I can make decisions on what to do with it. I can't figure out if the output is going to STDERR or if nothing is even running. David Corcoran wrote: > When in windoze I usually do something like this: > > open CMD,"program |" or die; > > while () { > print; > } however, this shows the same symptoms, mogrify works, identify doesn't . Colin Meyer suggested trying the PerlMagick module. I am trying to get it built but it requires nmake, which I have as part of Visual Studio but during the make, it complains about missing .dlls which I am still trying to track down. Keep those ideas coming. I am running win98 btw. Rich --- Matt Tucker wrote: > -- Richard Wood spake > thusly: > > > I am having a problem with backticks and I am > looking > > for new ideas on what it could be. > > > When I write a very simple script such as: > > > > perl -e "print `mogrify`;" > > > > I get the usage only if I use mogrify, or convert. > > > If I try identify, composite, or montage, I get > > nothing. > > > Could some of the commands be writing to something > > other than STDOUT? like STDERR? > > Yes. Backticks fail to capture STDERR, and many > programs write their > usage to that. However, you should still be seeing > the output, since > the backticks aren't capturing it. > > On unix I'd say do '2>&1', but obviously that's not > a choice without > installing cygwin. The other option is to use > something like > IPC::Open3. As I recall there's an OO interface to > that functionality > that works rather nicely, but I can't remember what > it's called. > > ATTACHMENT part 2 application/pgp-signature ===== Richard O. Wood Wildwood IT Consultants, Inc. wildwood_players@yahoo.com 425.941.9437 __________________________________________________ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com ----- End forwarded message ----- -- *==============================================================================* | Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# | | tim@consultix-inc.com www.consultix-inc.com www.softwareprofessor.com | | FEB: Perl; APR: Shell; Int. & OO Perl; Perl DataBase; JUNE: Basic UNIX, Perl | *------------------------------------------------------------------------------* | NEW Seminar Series! "DAMIAN CONWAY's Adv. Perl Workshop"; Seattle, 7/15-18 | | Adv. OOP * Adv. Module Implementation Techniques * Programming in Perl 6 | *==============================================================================* ----- End forwarded message ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From rowdenw at eskimo.com Sun Mar 17 18:50:21 2002 From: rowdenw at eskimo.com (William Rowden) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Perl upgrade broke mod_perl. Message-ID: Usually I happily use Perl and leave its administration to someone else. Now, *I'm* the administrator, and I'm not certain where to look. Without warning me, Red Hat's up2date daemon upgraded Perl from 5.6.0 to 5.6.1 (never mind what the rest of the world uses). This resulted in the following mod_perl errors upon restarting Apache: [error] Can't locate strict.pm in @INC (@INC contains: /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl . /etc/httpd/ /etc/httpd/lib/perl) at /usr/lib/perl5/site_perl/5.6.0/i386-linux/Apache.pm line 3. BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.6.0/i386-linux/Apache.pm line 3. Compilation failed in require at (eval 1) line 3. Since I personally use Perl but not mod_perl, and I'm accustomed to someone else administering Perl, I upgraded mod_perl in the hope that would fix it. When that didn't work, I tried creating a symbolic link from 5.6.0 to 5.6.1, but that produced errors like these: [error] Perl lib version (v5.6.1) doesn't match executable version (v5.6.0) at /usr/lib/perl5/5.6.0/i386-linux/Config.pm line 21. Compilation failed in require at /usr/lib/perl5/5.6.0/i386-linux/DynaLoader.pm line 25. BEGIN failed--compilation aborted at /usr/lib/perl5/5.6.0/i386-linux/DynaLoader.pm line 25. Compilation failed in require at /usr/lib/perl5/site_perl/5.6.0/i386-linux/mod_perl.pm line 4. BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.6.0/i386-linux/mod_perl.pm line 4. Compilation failed in require at /usr/lib/perl5/site_perl/5.6.0/i386-linux/Apache.pm line 4. BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.6.0/i386-linux/Apache.pm line 4. Compilation failed in require at (eval 1) line 3. It seems I need to recompile something somewhere. Would someone suggest what? -- -William When they find out who *you* are they'll pad the cell. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From cmeyer at helvella.org Sun Mar 17 21:29:07 2002 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Perl upgrade broke mod_perl. In-Reply-To: ; from rowdenw@eskimo.com on Sun, Mar 17, 2002 at 04:50:21PM -0800 References: Message-ID: <20020317192907.F28059@hobart.helvella.org> On Sun, Mar 17, 2002 at 04:50:21PM -0800, William Rowden wrote: > Usually I happily use Perl and leave its administration to someone > else. Now, *I'm* the administrator, and I'm not certain where to > look. > > Without warning me, Red Hat's up2date daemon upgraded Perl from 5.6.0 > to 5.6.1 (never mind what the rest of the world uses). This resulted > in the following mod_perl errors upon restarting Apache: > > [error] Can't locate strict.pm in @INC (@INC contains: > /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 > /usr/lib/perl5/site_perl/5.6.0/i386-linux > /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl . > /etc/httpd/ /etc/httpd/lib/perl) at > /usr/lib/perl5/site_perl/5.6.0/i386-linux/Apache.pm line 3. > BEGIN failed--compilation aborted at > /usr/lib/perl5/site_perl/5.6.0/i386-linux/Apache.pm line 3. > Compilation failed in require at (eval 1) line 3. > > Since I personally use Perl but not mod_perl, and I'm accustomed to > someone else administering Perl, I upgraded mod_perl in the hope that > would fix it. When that didn't work, I tried creating a symbolic link > from 5.6.0 to 5.6.1, but that produced errors like these: You'll need to reinstall mod_perl from scratch when upgrading Perl. Typically this includes recompiling Apache as well, as mod_perl is statically included in the httpd binary. It looks like you may not have done this, and httpd is looking for the older perl stuff still. Be sure to use your new perl binary when running the 'perl Makefile.PL' step for mod_perl. mod_perl is a bit more difficult to install that most CPAN modules. If you've never done so before, then this will help: http://perl.apache.org/guide/install.html There's alot there, so if you need a quick fix try: http://perl.apache.org/guide/install.html#The_All_In_One_Way Have fun, -C. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From ben at reser.org Sun Mar 17 22:05:26 2002 From: ben at reser.org (Ben Reser) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Perl upgrade broke mod_perl. References: Message-ID: <20020317200526.C17052@gyrus.brain.org> On Sun, Mar 17, 2002 at 04:50:21PM -0800, William Rowden wrote: > Usually I happily use Perl and leave its administration to someone > else. Now, *I'm* the administrator, and I'm not certain where to > look. > > Without warning me, Red Hat's up2date daemon upgraded Perl from 5.6.0 > to 5.6.1 (never mind what the rest of the world uses). This resulted > in the following mod_perl errors upon restarting Apache: > > [error] Can't locate strict.pm in @INC (@INC contains: /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl . /etc/httpd/ /etc/httpd/lib/perl) at /usr/lib/perl5/site_perl/5.6.0/i386-linux/Apache.pm line 3. > BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.6.0/i386-linux/Apache.pm line 3. > Compilation failed in require at (eval 1) line 3. I think your mod_perl version needs to be compiled against your perl version. So rebuild mod_perl if you did it by hand or if you installed an rpm go get an update (guessing you did it by hand because up2date should have gotten a new version of mod_perl too if it updated perl). Alternately if you have a backup of your 5.6.0 perl library files you should be able to restore them and mod_perl should work. (/usr/lib/perl5/5.6.0/... and /usr/lib/perl5/site_perl/5.6.0/... as a guess from what the error shown above). At any rate I strongly recommend people not run programs that install updates for them. It's one thing to have a program that tells you what you need. But upgrading things like perl requires some thought into how it will effect your system. -- Ben Reser http://ben.reser.org What difference does it make to the dead, the orphans, and the homeless, whether the mad destruction is wrought under the name of totalitarianism or the holy name of liberty and democracy? - Ghandi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From brian at tangent.org Sun Mar 17 22:49:49 2002 From: brian at tangent.org (Brian Aker) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Perl upgrade broke mod_perl. In-Reply-To: <20020317200526.C17052@gyrus.brain.org> References: <20020317200526.C17052@gyrus.brain.org> Message-ID: <1016426990.12177.1107.camel@avenger> On Sun, 2002-03-17 at 20:05, Ben Reser wrote: > I think your mod_perl version needs to be compiled against your perl Right, mod_perl has a statically linked copy of perl in it. It will continue to need the 5.6.0 libraries. > At any rate I strongly recommend people not run programs that install > updates for them. It's one thing to have a program that tells you what > you need. But upgrading things like perl requires some thought into how > it will effect your system. The other thing is to just use the mod_perl that came along with 7.2. Unless you have some needs that are not being met with the Apache that comes along with 7.2, then just let the package management system handle all of this. -Brian -- _______________________________________________________ Brian Aker, brian@tangent.org Slashdot Senior Developer Seattle, Washington http://tangent.org/~brian/ http://askbrian.org/ _______________________________________________________ You can't grep a dead tree. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From sweetsue at sweethomes.com Mon Mar 18 10:39:54 2002 From: sweetsue at sweethomes.com (S Bullo) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Getting around dollar signs being removed Message-ID: Same ol' program. This time I don't think I need to put in coding as this should be a fairly straight forward problem. I have a script that sends an email out to scripts on other servers. Apparently some of the outside server programs have something in place that automatically strips out "$'" and the number just after. Is there an easy way to ensure these don't get removed? TIA! Susanne Bullo Technician - One Site Marketing -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20020318/59ee47b3/attachment.htm From tim at consultix-inc.com Mon Mar 18 11:24:44 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Getting around dollar signs being removed In-Reply-To: References: Message-ID: <20020318092444.A17297@timji.consultix.wa.com> On Mon, Mar 18, 2002 at 08:39:54AM -0800, S Bullo wrote: > Same ol' program. This time I don't think I need to put in coding as this > should be a fairly straight forward problem. I have a script that sends an > email out to scripts on other servers. Apparently some of the outside > server programs have something in place that automatically strips out "$'" > and the number just after. Is there an easy way to ensure these don't get > removed? > > TIA! > > Susanne Bullo > Technician - One Site Marketing Susanne, Please identify your relationship to the people to whom you will be sending the Email messages you're trying to craft with Perl, apparently without any knowledge of the language. We have reason to believe that you are in the business of sending SPAM, which is a crime, or else providing SPAM distribution services to clients, and we have a right to take that information into account before offering you any assistance, or permiting you to continue reading this list. Note to SPAMmees: Spamassassin, by Simon Cozens, is really good; it's cut my personal spam down by about 95%! It's written in Perl, of course! (see spamassassin.org). ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From sweetsue at sweethomes.com Mon Mar 18 11:35:08 2002 From: sweetsue at sweethomes.com (S Bullo) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Getting around dollar signs being removed In-Reply-To: <20020318092444.A17297@timji.consultix.wa.com> Message-ID: Not at all - this is a program being created for a client to autosend email to safelists only. It is not spam - I've never been in the business of sending spam. Susanne Bullo Technician - One Site Marketing -----Original Message----- From: Tim Maher [mailto:tim@consultix-inc.com] Sent: Monday, March 18, 2002 9:25 AM To: S Bullo Cc: spug-list@pm.org Subject: Re: SPUG: Getting around dollar signs being removed On Mon, Mar 18, 2002 at 08:39:54AM -0800, S Bullo wrote: > Same ol' program. This time I don't think I need to put in coding as this > should be a fairly straight forward problem. I have a script that sends an > email out to scripts on other servers. Apparently some of the outside > server programs have something in place that automatically strips out "$'" > and the number just after. Is there an easy way to ensure these don't get > removed? > > TIA! > > Susanne Bullo > Technician - One Site Marketing Susanne, Please identify your relationship to the people to whom you will be sending the Email messages you're trying to craft with Perl, apparently without any knowledge of the language. We have reason to believe that you are in the business of sending SPAM, which is a crime, or else providing SPAM distribution services to clients, and we have a right to take that information into account before offering you any assistance, or permiting you to continue reading this list. Note to SPAMmees: Spamassassin, by Simon Cozens, is really good; it's cut my personal spam down by about 95%! It's written in Perl, of course! (see spamassassin.org). ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From Ryan.Parr at wwireless.com Mon Mar 18 11:35:02 2002 From: Ryan.Parr at wwireless.com (Parr, Ryan) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Getting around dollar signs being removed Message-ID: <6D6F0541E2B1D411A75B0002A513016D028002E3@wacorpml03.wwireless.com> That's weird behaviour. I wonder what the point would be? Anyways, I would send the e-mail as HTML using MIME::Lite and encode the dollar sign glyph: $ -- Ryan "Those who make peaceful revolution impossible will make violent revolution inevitable." -- John F. Kennedy -----Original Message----- From: S Bullo [mailto:sweetsue@sweethomes.com] Sent: Monday, March 18, 2002 8:40 AM To: Seattle Perl User's Group Subject: SPUG: Getting around dollar signs being removed Same ol' program. This time I don't think I need to put in coding as this should be a fairly straight forward problem. I have a script that sends an email out to scripts on other servers. Apparently some of the outside server programs have something in place that automatically strips out "$'" and the number just after. Is there an easy way to ensure these don't get removed? TIA! Susanne Bullo Technician - One Site Marketing -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20020318/421b1735/attachment.htm From tim at consultix-inc.com Mon Mar 18 11:40:21 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Getting around dollar signs being removed In-Reply-To: References: <20020318092444.A17297@timji.consultix.wa.com> Message-ID: <20020318094021.A17543@timji.consultix.wa.com> On Mon, Mar 18, 2002 at 09:35:08AM -0800, S Bullo wrote: > Not at all - this is a program being created for a client to autosend email > to safelists only. It is not spam - I've never been in the business of > sending spam. > > Susanne Bullo > Technician - One Site Marketing That's nice to hear. Now show us the program that you want us to help you with. ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From sweetsue at sweethomes.com Mon Mar 18 11:50:47 2002 From: sweetsue at sweethomes.com (S Bullo) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Getting around dollar signs being removed In-Reply-To: <20020318094021.A17543@timji.consultix.wa.com> Message-ID: It's rather large, I'll put in part of the pertinent portion: my $query = "select blah, blah, blah"; $buffer .= "===> Executing Query: $query\n\n"; my $sth = $dbh->prepare($query); my $rc = $sth->execute(); while(@row = $sth->fetchrow_array()) { if (blah, blah, blah) { $row[7] =~ s|#| |g; $row[8] =~ s|#| |g; $row[10] =~ s| |_|g; my $login = "$row[0]Action=Login$row[1]$row[2]$row[3]$row[4]"; my $sec_file_path = "../var/www/html/automail/members/data/$row[9]"; my $data = "../var/www/html/automail/members/data/$row[9]/$row[10].html"; my $action = "action= Send This Message &subject=$row[7]&priority=3&message=$row[8]"; my $mailto = "$row[11]"; my $outfile = "index.html"; my $filename = "$sec_file_path/$outfile"; if (! -d "$sec_file_path") { system "mkdir -p $sec_file_path" } if (! -d "$data") { system "touch $data" } { system "curl -s \"$login\"" } { system "curl -s -o $data -d \"$action\" $mailto" } open (FILE,">>$filename") or die "Error opening $filename: $!"; { print FILE "Report on $date for '$row[10]'
"; } close (FILE); $email = "$row[12]"; $subject = "Your $row[10] Mailing Information"; $message = "Your ad has been sent to $row[10]. For further details, please log into: URL HERE If you have any questions please reply back to this email. Thank You, Onesite Market"; %mail = ( To => $email, >From => 'support@url.com', Subject => $subject, Message => $message ); sendmail(%mail) or die $Mail::Sendmail::error; print "OK. Log says:\n", $Mail::Sendmail::log; } I realize some of this coding can (and will) be done better - just trying to hammer out the workings first. $row[8] is where the body of the message is placed. It's at this point that just some outside safelist programs are stripping out the $ and the character just after (i.e. $49.95 becomes 9.95, $9.95 become .95). TIA! Susanne Bullo Technician - One Site Marketing -----Original Message----- From: Tim Maher [mailto:tim@consultix-inc.com] Sent: Monday, March 18, 2002 9:40 AM To: S Bullo Cc: spug-list@pm.org Subject: Re: SPUG: Getting around dollar signs being removed On Mon, Mar 18, 2002 at 09:35:08AM -0800, S Bullo wrote: > Not at all - this is a program being created for a client to autosend email > to safelists only. It is not spam - I've never been in the business of > sending spam. > > Susanne Bullo > Technician - One Site Marketing That's nice to hear. Now show us the program that you want us to help you with. ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From nbhd at airborne.com Mon Mar 18 11:58:55 2002 From: nbhd at airborne.com (Bryan Dees) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: TLS SSL FTP Message-ID: <200203181800.KAA15823@goahp65.airborne.com> Hello, Has anyone found a decent 'unix' command shell client or Perl mod that can be scripted for use with TLS SSL FTP? I've tried a couple that I found, lftp and ftps by BSD. The BSD client works extremely well if you dont disable the login using '-n' and attempt to script it. When you turn on the '-n' parameter the client no longer attempts to establish the TLS handshake and throws the client into clear text FTP. Thanks in advance for your support. Bryan Dees Unix Systems Analyst Airborne Express bryan.dees@airborne.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From ben at reser.org Mon Mar 18 12:01:54 2002 From: ben at reser.org (Ben Reser) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Getting around dollar signs being removed In-Reply-To: ; from sweetsue@sweethomes.com on Mon, Mar 18, 2002 at 08:39:54AM -0800 References: Message-ID: <20020318100154.G17052@gyrus.brain.org> On Mon, Mar 18, 2002 at 08:39:54AM -0800, S Bullo wrote: > Same ol' program. This time I don't think I need to put in coding as > this should be a fairly straight forward problem. I have a script > that sends an email out to scripts on other servers. Apparently some > of the outside server programs have something in place that > automatically strips out "$'" and the number just after. Is there an > easy way to ensure these don't get removed? Not sure why $ is being stripped in your emails. However, you do have a couple options. First of all you might try enconding the script with something like uuencode. However, if you're just updating scripts on lots of machines I'd use rsync. Pretty handy little tool. Or rdist. http://rsync.samba.org and http://www.magnicomp.com/rdist/rdist.shtml -- Ben Reser http://ben.reser.org What difference does it make to the dead, the orphans, and the homeless, whether the mad destruction is wrought under the name of totalitarianism or the holy name of liberty and democracy? - Ghandi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From mbustad at Myrio.com Mon Mar 18 12:34:05 2002 From: mbustad at Myrio.com (Matthew.Bustad) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: TLS SSL FTP In-Reply-To: <200203181800.KAA15823@goahp65.airborne.com> Message-ID: Have you looked at cURL http://curl.haxx.se/ -Matthew.Bustad@Seaslug.org On Mon, 18 Mar 2002, Bryan Dees wrote: > Hello, > > Has anyone found a decent 'unix' command shell client or Perl mod that can be > scripted for use with TLS SSL FTP? > > I've tried a couple that I found, lftp and ftps by BSD. The BSD client works > extremely well if you dont disable the login using '-n' and attempt to script > it. When you turn on the '-n' parameter the client no longer attempts to > establish the TLS handshake and throws the client into clear text FTP. > > Thanks in advance for your support. > > > Bryan Dees > Unix Systems Analyst > Airborne Express > bryan.dees@airborne.com > > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From dcd at tc.fluke.com Mon Mar 18 12:48:02 2002 From: dcd at tc.fluke.com (David Dyck) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Getting around dollar signs being removed (fwd) Message-ID: It appears that the variable $row[8] is stuffed into a variable that is passed as a quoted string $action to system. > { system "curl -s -o $data -d \"$action\" $mailto" } Although it wasn't stated which OS was being used I think that the shell is interpreting the "$" change this to something like { system "curl -s -o '$data' -d '$action' '$mailto' " } or probably better yet: { system qw(curl -s -o), $data, qw(-d), $action, $mailto } And of course the the return code from system should be check checked. perldoc -f system - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tim at consultix-inc.com Tue Mar 19 09:20:01 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: DBI/XML/SAX Meeting Tonight Message-ID: <20020319072001.A16067@timji.consultix.wa.com> NOTE: See comments below about pre-meeting Dinner and Drinks March 2002 Seattle Perl User's Group Meeting ------------------------------------------------------ Title: Relational Databases and XML: using the DBI with SAX Speaker: Colin Meyer, Helvella Time: Tuesday, March 19, 2002 7-9pm Location: SAFECO bldg, Brooklyn St. and NE 45th St. Cost: Admission is free and open to the general public. Info: http://seattleperl.org/ Topics: . Overview of XML and its uses . Processing XML with SAX . Writing a SAX handler to extract data from XML for insertion into an RDB . Writing a SAX driver to extract data from an RDB and generate XML Attendees who have not seen Colin's introductory DBI talk, or are not familiar with the Perl Database Interface are encouraged to review: http://helvella.org/intro_dbi/ , and "perldoc DBI" This talk is a preview of some of the material in Colin's "Database Programming with Perl" training course. There will be a public offering of this course from 4/22 to 4/25. For details, see: http://teachmeperl.com A free copy of the (very detailed) student notes for the class will be given away during the meeting! Tim Maher will be dining tonight at the Cedars restaurant, at 50th St. and Brooklyn, in the University District, near the Safeco building where the meeting will take place. The phone number is 527-5247. Interested others are welcome to join him. Tim will probably show up around 5:45pm, but it might be later. As usual, others may choose to congregate at the Bigtime Brewery and Alehouse, to conduct their liquid preparations for the 7pm meeting. ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From B.Strockis at agon.com.br Wed Mar 20 05:32:38 2002 From: B.Strockis at agon.com.br (B.Strockis@agon.com.br) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Reduce Travel Costs Message-ID: <1016623423.0203464635@mail.matrix.com.br> An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20020320/6793f7cf/attachment.htm From asa.martin at attws.com Thu Mar 21 19:41:49 2002 From: asa.martin at attws.com (Martin, Asa) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Reference to a hash Message-ID: <67FC0E2A32D0D31194500008C7CF2E6F055290B4@wa-msg09.entp.attws.com> I have a data structure, Hash of Hashes. Most of the entries are single values. Some are however other hashes. I use $key as a numeric number incremented for each hash with each key having different headings. For example.. $HoH{$key}{$heading1} = $value1; $HoH{$key}{$heading2} = $value2; .... For the times when $value is not a scalar, I populate a hash of values. I then tried to associate that hash as a value like so: $HoH{$key}{$heading} = \%hash; For some reason this did not work. When I went to access it as %{HoH{$key}{$heading}} it did not contain the original data but was empty. So I had to do this to populate it. for (keys %hash) { $HoH{$key}{$heading}{$_} = $hash{$_}; } Any ideas as to what's going on here? I'm sure I'm missing something obvious (certainly wouldn't be the first time). Thanks, Asa C Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20020321/65b27ee3/attachment.htm From jimfl at tensegrity.net Thu Mar 21 22:16:35 2002 From: jimfl at tensegrity.net (Jim Flanagan) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Reference to a hash In-Reply-To: <67FC0E2A32D0D31194500008C7CF2E6F055290B4@wa-msg09.entp.attws.com> References: <67FC0E2A32D0D31194500008C7CF2E6F055290B4@wa-msg09.entp.attws.co m> Message-ID: <577943.1016741795@[0.0.0.0]> What may be happening to you is that you're assigning \%hash to the HoH, then undef-ing %hash later on. This is similar to the common references mistake is something along the lines of while (my $line = ) { %hash = my_func($line); ... $things{$key} = \%hash; } Only to find later that the hash references all contain the same data! It's because they're all references to the same hash, the one that was constructed in the last iteration through the loop. What you really want is an anonymous hashref, rather than a reference to a specific named hash. One way to get that is the loop that you have below. Another way is to just say $HoH{$key}{$heading} = {%hash}; This creates a new, anonymous hash with the same keys/values as %hash. --On Thursday, March 21, 2002 5:41 PM -0800 "Martin, Asa" wrote: > I have a data structure, Hash of Hashes. Most of the entries are > single values. Some are however other hashes. I use $key as a > numeric number incremented for each hash with each key having > different headings. For example.. > > $HoH{$key}{$heading1} = $value1; > $HoH{$key}{$heading2} = $value2; > .... > > For the times when $value is not a scalar, I populate a hash of > values. I then tried to associate that hash as a value like so: > > $HoH{$key}{$heading} = \%hash; > > For some reason this did not work. When I went to access it as > %{HoH{$key}{$heading}} it did not contain the original data but was > empty. So I had to do this to populate it. > > for (keys %hash) { > $HoH{$key}{$heading}{$_} = $hash{$_}; > } > > Any ideas as to what's going on here? I'm sure I'm missing something > obvious (certainly wouldn't be the first time). > > Thanks, > > Asa C Martin -- ::jim flanagan http://jimfl.tensegrity.net mailto:jimfl%40t%65ns%65gr%69ty.n%65t - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From asa.martin at attws.com Thu Mar 21 22:57:25 2002 From: asa.martin at attws.com (Martin, Asa) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Reference to a hash Message-ID: <67FC0E2A32D0D31194500008C7CF2E6F055290B5@wa-msg09.entp.attws.com> Jim describes exactly what was happening. Changing \%hash to {%hash} made it work correctly. Thank you very much. Asa -----Original Message----- From: Jim Flanagan [mailto:jimfl@tensegrity.net] Sent: Thursday, March 21, 2002 8:17 PM To: Martin, Asa; spug-list@pm.org Subject: Re: SPUG: Reference to a hash What may be happening to you is that you're assigning \%hash to the HoH, then undef-ing %hash later on. This is similar to the common references mistake is something along the lines of while (my $line = ) { %hash = my_func($line); ... $things{$key} = \%hash; } Only to find later that the hash references all contain the same data! It's because they're all references to the same hash, the one that was constructed in the last iteration through the loop. What you really want is an anonymous hashref, rather than a reference to a specific named hash. One way to get that is the loop that you have below. Another way is to just say $HoH{$key}{$heading} = {%hash}; This creates a new, anonymous hash with the same keys/values as %hash. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tuck at whistlingfish.net Fri Mar 22 02:24:46 2002 From: tuck at whistlingfish.net (Matt Tucker) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Reference to a hash In-Reply-To: <577943.1016741795@[0.0.0.0]> References: <67FC0E2A32D0D31194500008C7CF2E6F055290B4@wa-msg09.entp.attw s.com> <577943.1016741795@[0.0.0.0]> Message-ID: <111690000.1016785481@flashingchance.whistlingfish.net> -- Jim Flanagan spake thusly: > What you really want is an anonymous hashref, rather than a > reference to a specific named hash. One way to get that is the loop > that you have below. Another way is to just say > > $HoH{$key}{$heading} = {%hash}; > > This creates a new, anonymous hash with the same keys/values as > %hash. Note that this essentially does a copy of the hash when you do that. Sometimes a slightly more efficient solution is to use a locally scoped hash that gets created anew each time. For instance, instead of: while (my $line = ) { %hash = my_func($line); ... $things{$key} = {%hash}; } It would be slightly more efficient (for large hashes at least) to do: while (my $line = ) { my %hash = my_func($line); ... $things{$key} = \%hash; } Since %hash gets recreated each time through the loop, you don't have the problem of it getting overwritten. This will only make a difference for very large hashes, but I figured it was worth pointing out. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/spug-list/attachments/20020322/d7be643c/attachment.bin From james at banshee.com Fri Mar 22 11:35:31 2002 From: james at banshee.com (James Moore) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Reference to a hash In-Reply-To: <577943.1016741795@[0.0.0.0]> Message-ID: <002a01c1d1c7$f73cab50$797ba8c0@gealach> I find that when I'm using the kind of construction Jim describes it's because I'm planning on doing some processing to the hash after creating it: while (my $line = ) { %hash = my_func($line); ... $hash{foo} = $bar; $things{$key} = \%hash; } Rather than the anonymous hash construction using {}, I usually make the hash a 'my' variable: while (my $line = ) { my %hash = my_func($line); ... $hash{foo} = $bar; $things{$key} = \%hash; } Doing it this way I find is slightly clearer than using $things{$key}{foo} = $bar, plus it involves slightly less typing. It's really only an issue for slightly more complex operations. I suspect that you get to this point naturally if you're using 'use strict.' Strict is your friend - don't attempt to write non-trivial perl code without it. ------------------------------------------------------------ James M. Moore james@banshee.com Banshee Software: Web software development Open Source / .NET / Embedded - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From asa.martin at attws.com Fri Mar 22 11:51:28 2002 From: asa.martin at attws.com (Martin, Asa) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Reference to a hash Message-ID: <67FC0E2A32D0D31194500008C7CF2E6F055290B6@wa-msg09.entp.attws.com> I agree that using "my %hash" would be the preferred method. I use strict as well. However, in my case I couldn't create a new %hash variable on each iteration through the loop because %hash was not completed for several iteration through the loop. Not to bore everyone, but he's a sample record of what I was parsing: { ObjectName=name; ClassName=1.3.6.1.4.1.9.1.45; SysDetails=Cisco Internetwork Operating System Software IOS (tm) RSP Software (RSP-JSV-M), Version 12.0(7)T, RELEASE SOFTWARE (fc2) Copyright (c) 1986-1999 by cisco Systems, Inc. Compiled Mon 06-Dec-99 19:40 by phanguye; NetAddress=xxx.xxx.xxx.xxx; NetProtocol=0; Type=0; AccessString=*****; LayoutHint=0; Action=0; Parents={ __item__=xxx.xxx.xxx.xxx; __item__=xxx.xxx.xxx.xxx; __item__=xxx.xxx.xxx.xxx; __item__=xxx.xxx.xxx.xxx; __item__=xxx.xxx.xxx.xxx; __item__=xxx.xxx.xxx.xxx; __item__=xxx.xxx.xxx.xxx; __item__=xxx.xxx.xxx.xxx; __item__=xxx.xxx.xxx.xxx; __item__=xxx.xxx.xxx.xxx; }; SnmpStatus=HasAccess; sysDescr=Cisco Internetwork Operating System Software IOS (tm) RSP Software (RSP-JSV-M), Version 12.0(7)T, RELEASE SOFTWARE (fc2) Copyright (c) 1986-1999 by cisco Systems, Inc. Compiled Mon 06-Dec-99 19:40 by phanguye; sysLocation=Location string; sysContact=Person and phone number; sysName=name; InapNeLifeCounter=1; Locator=1.0.14.0.0.12.1; }; As I went through the loop I had to set "flags" to know where I was in processing. The %hash was for the Parents field. It wasn't finished until I hit '};'. Then I would assign it to %HoH{$recordnum}{Parents}. And since all the keys of %hash were __item__ I also had to create a small subroutine that made the key unique. What joys. In addition, some of the fields, like sysDecr above split over multiple lines. It was kind of challenging. But I've got it figured out now. Thanks again for everyone's input. Asa -----Original Message----- From: James Moore [mailto:james@banshee.com] Sent: Friday, March 22, 2002 9:36 AM To: spug-list@pm.org Subject: RE: SPUG: Reference to a hash I find that when I'm using the kind of construction Jim describes it's because I'm planning on doing some processing to the hash after creating it: while (my $line = ) { %hash = my_func($line); ... $hash{foo} = $bar; $things{$key} = \%hash; } Rather than the anonymous hash construction using {}, I usually make the hash a 'my' variable: while (my $line = ) { my %hash = my_func($line); ... $hash{foo} = $bar; $things{$key} = \%hash; } Doing it this way I find is slightly clearer than using $things{$key}{foo} = $bar, plus it involves slightly less typing. It's really only an issue for slightly more complex operations. I suspect that you get to this point naturally if you're using 'use strict.' Strict is your friend - don't attempt to write non-trivial perl code without it. ------------------------------------------------------------ James M. Moore james@banshee.com Banshee Software: Web software development Open Source / .NET / Embedded - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tuck at whistlingfish.net Fri Mar 22 12:37:31 2002 From: tuck at whistlingfish.net (Matt Tucker) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Reference to a hash In-Reply-To: <67FC0E2A32D0D31194500008C7CF2E6F055290B6@wa-msg09.entp.attws.com> References: <67FC0E2A32D0D31194500008C7CF2E6F055290B6@wa-msg09.entp.attw s.com> Message-ID: <103860000.1016822248@flashingchance.whistlingfish.net> -- "Martin, Asa" spake thusly: > As I went through the loop I had to set "flags" to know where I was in > processing. The %hash was for the Parents field. It wasn't finished > until I hit '};'. Then I would assign it to > %HoH{$recordnum}{Parents}. And since all the keys of %hash were > __item__ I also had to create a small subroutine that made the key > unique. What joys. Since there's no associated key, why not just use an array? It seems like you're representing a list for the Parents field; it would make sense to use one: %HoH{$recordnum}{Parents} = [ @parents ]; > In addition, some of the fields, like sysDecr > above split over multiple lines. It was kind of challenging. But I've > got it figured out now. > > Thanks again for everyone's input. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: not available Url : http://mail.pm.org/archives/spug-list/attachments/20020322/04b6dbce/attachment.bin From asa.martin at attws.com Fri Mar 22 12:58:34 2002 From: asa.martin at attws.com (Martin, Asa) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Reference to a hash Message-ID: <67FC0E2A32D0D31194500008C7CF2E6F055290B8@wa-msg09.entp.attws.com> That would work for Parents, but not for all fields because, although my sample didn't show it, Parents isn't the only embedded record within a record like that. And sometimes the keys of the embedded field aren't always the same, some are different. For example: { ObjectName=name; ClassName=1.3.6.1.4.1.9.1.258; NetAddress=xxx.xxx.xxx.xxx; NetProtocol=0; Type=1; AccessString=******; LayoutHint=0; Action=0; Parents={ __item__=xxx.xxx.xxx.xxx; __item__=name; __item__=xxx.xxx.xxx.xxx; }; ifIndex=15; ifDescr=Vlan; ifAlias=; ifSpeed=1000000000; ifAdminStatus=1; locIfDescr=; ifType=6; HSRPGroupAddresses={ HSRPAddress1=xxx.xxx.xxx.xxx/255.255.255.128; }; SnmpStatus=NoAccess; InapNeLifeCounter=1; Locator=1.0.14.0.0.12.1.0.0.0.6.0; }; -----Original Message----- From: Matt Tucker [mailto:tuck@whistlingfish.net] Sent: Friday, March 22, 2002 10:38 AM To: Martin, Asa Cc: spug-list@pm.org Subject: RE: SPUG: Reference to a hash -- "Martin, Asa" spake thusly: > As I went through the loop I had to set "flags" to know where I was in > processing. The %hash was for the Parents field. It wasn't finished > until I hit '};'. Then I would assign it to > %HoH{$recordnum}{Parents}. And since all the keys of %hash were > __item__ I also had to create a small subroutine that made the key > unique. What joys. Since there's no associated key, why not just use an array? It seems like you're representing a list for the Parents field; it would make sense to use one: %HoH{$recordnum}{Parents} = [ @parents ]; > In addition, some of the fields, like sysDecr > above split over multiple lines. It was kind of challenging. But I've > got it figured out now. > > Thanks again for everyone's input. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From laurieanderson at futurevisiontoday.com Sat Mar 23 15:36:37 2002 From: laurieanderson at futurevisiontoday.com (Laurie Anderson) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: re: your classified ad Message-ID: <200203231336431.SM01444@fvt-s01> Thanks for submitting your link. Submitting your URL to FFAs, classified sites, and search engines is a good start, but it's just the tip of the iceberg. You may have a great website offering the best products or services, but all of that means nothing if no one knows you exist. When your site is competing with over 400 million other web pages, you need an unfair advantage. We can give you that advantage. Click here for more information: http://www.futurevisiontoday.com/promotion/default.asp?AID=la&Email=spug-list%40pm.org ********************************************************** Note: If your e-mail program did not display the link correctly, simply copy and paste the following line into your browser's address bar and hit [ENTER]: http://www.futurevisiontoday.com/promotion/default.asp?AID=la&Email=spug-list%40pm.org ********************************************************** Why are you on our mailing list? You opted-in to our mailing list when you submitted your ad or URL (either manually or through a submission service) to one of our FFA or classified sites. To unsubscribe, please click here: http://www.futurevisiontoday.com/promotion/remove.asp?AID=la&Email=spug-list%40pm.org ********************************************************** - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From Gouranga Tue Mar 26 04:47:26 2002 From: Gouranga (Gouranga) Date: Wed Aug 4 00:08:49 2004 Subject: SPUG: Call Out Gouranga Be Happy Message-ID: <200203261050.g2QAo8Y04105@mail.pm.org> An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20020326/868f9191/attachment.htm From iwebmaster at empal.com Tue Mar 26 08:07:40 2002 From: iwebmaster at empal.com (=?ks_c_5601-1987?B?vsbAzLX7tfu1+w==?=) Date: Wed Aug 4 00:08:50 2004 Subject: SPUG: =?ks_c_5601-1987?B?W8irurhds9fGvMHwwMwguLi15yC79bfOv+4gsMu79r+jwfjA1LTPtNku?= Message-ID: <200203261410.g2QEAKY06912@mail.pm.org> ????? ???? ????? ??? ???? ????? ?? more» ????? ?? ??? ? ??? ???? ????? ????. ??? ??????? ???? ????? ??? ??? ??????? ??? ??? ??? ?? ??? ??? ???? ??? ???? ????. ?? ?? ??? ?? ? ?? ?? ?? ??????? ??? ?? ??? ???? ??? ?????. ???? ??? ?? ??? ??? ??? ? ??? ???? ???? ???? ?? ???, ? ??? ?? ???? ??,??,?? ????? ???. ?? ??? ?????? ???? ????? ????? ??? ???? ???? ???? ???? ???. ????? ???? ???? ?? ? ????. ????? ??? ?? ?? ???? ???? ??? ??? ?? ???? ??? ?????? ????????. ?? ?? ????? ???? ? ??? ?? ??? ?????? ???????. ????? ?????? ? ??? ????? ??????. ?????? ???? ??? ???? ???? ? ????? ?? ?? ????» ??? ??? ?? ???? ??? ????. ??? ??????. ??? ??? ????? ???? ?????? ??? ??? ??? ???? ????. ?????? ??? ??? ???? ??? ??? ??? ??? ???? ? ????. ????? ????? ????? ????? ?? ? ????. ???? ?? ???? ??? ???? ?????? ??????.???? ?? ???? ??? ?? ??? ?? ??? ???? ???? ????? ???? ?????. Copyright ? 1998-2002 (?)???? All rights reserved. mailto:iwebmaster ?????. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20020326/e3967e09/attachment.htm From pdarley at kinesis-cem.com Wed Mar 27 11:08:23 2002 From: pdarley at kinesis-cem.com (Peter Darley) Date: Wed Aug 4 00:08:50 2004 Subject: SPUG: Too Many Warnings Message-ID: Friends, I'm using some modules that throw up huge numbers of 'Use of uninitialized value' warnings, which aren't particularly interesting to me. Is there some way I can turn off just these warnings? Thanks, Peter Darley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jcokos at iwebsoftware.com Wed Mar 27 12:25:40 2002 From: jcokos at iwebsoftware.com (John Cokos) Date: Wed Aug 4 00:08:50 2004 Subject: SPUG: Perl Compiler / Byte Code Message-ID: <000d01c1d5bc$cd8aacf0$7197520c@iwebhome> Is it possible to "compile" a slew of .pm files (modules) into platform and machine independant byte code, and actually be able to use them ? I assume you'd end up with one big compiled file, and then a small .pl wrapper that basically loads it, and can execute. It would make delivery of large and complex CGI programs a heck of a lot easier, and I'd assume, a bit faster executing as well. I've monkeyed with the B:: stuff, but can't really make heads or tails of it. Has anyone been successful? John Cokos - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From Ryan.Parr at wwireless.com Wed Mar 27 12:33:02 2002 From: Ryan.Parr at wwireless.com (Parr, Ryan) Date: Wed Aug 4 00:08:50 2004 Subject: SPUG: Too Many Warnings Message-ID: <6D6F0541E2B1D411A75B0002A513016D0280036F@wacorpml03.wwireless.com> use warnings; no warnings 'uninitialized'; >From reading the warnings man page and code, I think that ought to do it. -- Ryan Parr Common sense is the collection of prejudices acquired by age eighteen. -- Albert Einstein -----Original Message----- From: Peter Darley [mailto:pdarley@kinesis-cem.com] Sent: Wednesday, March 27, 2002 9:08 AM To: SPUG Subject: SPUG: Too Many Warnings Friends, I'm using some modules that throw up huge numbers of 'Use of uninitialized value' warnings, which aren't particularly interesting to me. Is there some way I can turn off just these warnings? Thanks, Peter Darley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From Ryan.Parr at wwireless.com Wed Mar 27 12:48:27 2002 From: Ryan.Parr at wwireless.com (Parr, Ryan) Date: Wed Aug 4 00:08:50 2004 Subject: SPUG: Too Many Warnings Message-ID: <6D6F0541E2B1D411A75B0002A513016D02800371@wacorpml03.wwireless.com> I really should have prepended that with: Instead of using -w and appended it with: Make sure none of the modules actually set $^W... -- Ryan Parr Common sense is the collection of prejudices acquired by age eighteen. -- Albert Einstein -----Original Message----- From: Parr, Ryan Sent: Wednesday, March 27, 2002 10:33 AM To: SPUG Subject: RE: SPUG: Too Many Warnings use warnings; no warnings 'uninitialized'; >From reading the warnings man page and code, I think that ought to do it. -- Ryan Parr Common sense is the collection of prejudices acquired by age eighteen. -- Albert Einstein -----Original Message----- From: Peter Darley [mailto:pdarley@kinesis-cem.com] Sent: Wednesday, March 27, 2002 9:08 AM To: SPUG Subject: SPUG: Too Many Warnings Friends, I'm using some modules that throw up huge numbers of 'Use of uninitialized value' warnings, which aren't particularly interesting to me. Is there some way I can turn off just these warnings? Thanks, Peter Darley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From newsflash at happyonline.i-p.com Thu Mar 28 04:10:27 2002 From: newsflash at happyonline.i-p.com (CORPORATE NEWS) Date: Wed Aug 4 00:08:50 2004 Subject: SPUG: NEW TECHNOLOGY CUTS MULTI-NATIONAL COSTS Message-ID: <20020328101027.31984.qmail@happyonline.i-p.com> FOR IMMEDIATE RELEASE London, UK - WorldCall International Ltd has just announced the commercial release of a new next generation SMS service offering for mobile phones. The new service SMS-Dial allows international calls to be placed from mobile phones in any country for about the same price as a local mobile phone call. WorldCall has integrated the new SMS-Dial capability developed for mobile phone use into their existing prepaid rechargeable Global Phonecard product which was uniquely designed to work in all countries in the world and saves $100's on tel/fax/mobile phone bills. Additional facilities have also been incorporated which provide international travelers with a means of avoiding expensive mobile phone roaming charges and hotel telephone bills. Global Phonecards require no physical card and are delivered online by e-mail and are also distributed by a growing number of local resellers throughout the world. WorldCall provides reliable cost cutting telephone services to leading professionals worldwide. Customers include some of the largest global companies and humanitarian organizations operating in some of the remotest parts of the world. In challenged economic times, WorldCall provides a much needed universal solution to companies and individuals on all continents to immediately cut costs. For further information, please visit WorldCall's mirror website by clicking here http://www.world-call.tm---.rom.cd ===================================================================== THIS MESSAGE WAS DISTRIBUTED TO YOU BY THE CORPORATE NEWS MEDIA GROUP BECAUSE YOU PREVIOUSLY OPTED IN TO RECEIVE SUCH MESSAGES. IF YOU DO NOT WISH TO RECEIVE FURTHER NEWS ANNOUNCEMENTS PLEASE REPLY TO THIS MESSAGE WITH THE WORD UNSUBSCRIBE IN THE SUBJECT LINE. ===================================================================== -- _______________________________________________ Visit HappyOnline at http://www.happyonline.i-p.com! Get free e-mail and more there! Powered by Instant Portal - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From technews at happyonline.i-p.com Thu Mar 28 11:17:11 2002 From: technews at happyonline.i-p.com (CORPORATE NEWS) Date: Wed Aug 4 00:08:50 2004 Subject: SPUG: NEW TECHNOLOGY CUTS MULTI-NATIONAL COSTS Message-ID: <20020328171711.14801.qmail@happyonline.i-p.com> FOR IMMEDIATE RELEASE London, UK - WorldCall International Ltd has just announced the commercial release of a new next generation SMS service offering for mobile phones. The new service SMS-Dial allows international calls to be placed from mobile phones in any country for about the same price as a local mobile phone call. WorldCall has integrated the new SMS-Dial capability developed for mobile phone use into their existing prepaid rechargeable Global Phonecard product which was uniquely designed to work in all countries in the world and saves $100's on tel/fax/mobile phone bills. Additional facilities have also been incorporated which provide international travelers with a means of avoiding expensive mobile phone roaming charges and hotel telephone bills. Global Phonecards require no physical card and are delivered online by e-mail and are also distributed by a growing number of local resellers throughout the world. WorldCall provides reliable cost cutting telephone services to leading professionals worldwide. Customers include some of the largest global companies and humanitarian organizations operating in some of the remotest parts of the world. In challenged economic times, WorldCall provides a much needed universal solution to companies and individuals on all continents to immediately cut costs. For further information, please visit WorldCall's mirror website by clicking here http://www.world-call.tm---.rom.cd ===================================================================== THIS MESSAGE WAS DISTRIBUTED TO YOU BY THE CORPORATE NEWS MEDIA GROUP BECAUSE YOU PREVIOUSLY OPTED IN TO RECEIVE SUCH MESSAGES. IF YOU DO NOT WISH TO RECEIVE FURTHER NEWS ANNOUNCEMENTS PLEASE REPLY TO THIS MESSAGE WITH THE WORD UNSUBSCRIBE IN THE SUBJECT LINE. ===================================================================== -- _______________________________________________ Visit HappyOnline at http://www.happyonline.i-p.com! Get free e-mail and more there! Powered by Instant Portal - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From de1ton at freestart.hu Sat Mar 30 08:05:47 2002 From: de1ton at freestart.hu (-DELTON-) Date: Wed Aug 4 00:08:50 2004 Subject: SPUG: Kellemes Húsvéti Ünnepeket! Message-ID: Kedves Partnerünk! Kellemes Húsvéti Ünnepeket Kívánunk! DELTON www.delton.hu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org