Perl classified script..

2004-09-19 Thread Joe Echavarria

  
  Hi there, 

I am looking for a complete perl/mysql classified
software for an internet business. Something as
complete as http://www.esvon.com/products/cl/index.php
or better than that.

   Thanks..

   Joe. 



__
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




adding hash to a hash

2004-09-19 Thread JupiterHost.Net
Howdy group,
This seems like it should be simple, but I'm a bit stumped on the best 
way to do this:

I want to add a hash to a hash,
With arrays you could:
 push @arr2, @arr2;
but what is the best way to do that with a hash?
perl -MData::Dumper -mstrict -we 'my %q=(1=>2,3=>4);my 
%w=(5=>6,7=>8);print Dumper \%q;'

So how can I add %w to %q in that example?
IE so it outputs:
$VAR1 = {
  '1' => 2,
  '7' => 8,
  '5' => 6,
  '3' => 4
};
TIA
Lee.M - JupiterHost.Net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: adding hash to a hash

2004-09-19 Thread Felix Li

- Original Message - 
From: "JupiterHost.Net" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, September 19, 2004 6:56 PM
Subject: adding hash to a hash


> Howdy group,
> 
> This seems like it should be simple, but I'm a bit stumped on the best 
> way to do this:
> 
> I want to add a hash to a hash,
> With arrays you could:
>   push @arr2, @arr2;
> 
> but what is the best way to do that with a hash?
> 
> perl -MData::Dumper -mstrict -we 'my %q=(1=>2,3=>4);my 
> %w=(5=>6,7=>8);print Dumper \%q;'
> 
> So how can I add %w to %q in that example?
> 
> IE so it outputs:
> 
> $VAR1 = {
>'1' => 2,
>'7' => 8,
>'5' => 6,
>'3' => 4
>  };
> 
> TIA
> 
> Lee.M - JupiterHost.Net
> 

Wouldn't something like

my(%a)=(a1=>1,a2=>2);
my(%b)=(b1=>1,b2=>2);
my(%c)=huh(%a,%b);

...

sub huh {
  return @_;
   };

work?

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: adding hash to a hash

2004-09-19 Thread Jeff 'japhy' Pinyan
On Sep 19, JupiterHost.Net said:

>I want to add a hash to a hash,
>
>So how can I add %w to %q in that example?

The general way is:

  # to add %w to %q
  @q{keys %w} = values %w;

If there are overlapping keys, %w's values will be used.

-- 
Jeff "japhy" Pinyan %  How can we ever be the sold short or
RPI Acacia Brother #734 %  the cheated, we who for every service
http://japhy.perlmonk.org/  %  have long ago been overpaid?
http://www.perlmonks.org/   %-- Meister Eckhart


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: adding hash to a hash

2004-09-19 Thread Gunnar Hjalmarsson
Jeff 'japhy' Pinyan wrote:
On Sep 19, JupiterHost.Net said:
I want to add a hash to a hash,
So how can I add %w to %q in that example?
The general way is:
  # to add %w to %q
  @q{keys %w} = values %w;
If there are overlapping keys, %w's values will be used.
Why not just
%q = (%q, %w);
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: adding hash to a hash

2004-09-19 Thread Jeff 'japhy' Pinyan
On Sep 20, Gunnar Hjalmarsson said:

>Jeff 'japhy' Pinyan wrote:
>> On Sep 19, JupiterHost.Net said:
>>>
>>>I want to add a hash to a hash,
>>>
>>>So how can I add %w to %q in that example?
>>
>> The general way is:
>>
>>   # to add %w to %q
>>   @q{keys %w} = values %w;
>>
>> If there are overlapping keys, %w's values will be used.
>
>Why not just
>
> %q = (%q, %w);

Benchmark it to see which is better.  Using %q = (%w, %q) allows you to
keep %q's values, though.

-- 
Jeff "japhy" Pinyan %  How can we ever be the sold short or
RPI Acacia Brother #734 %  the cheated, we who for every service
http://japhy.perlmonk.org/  %  have long ago been overpaid?
http://www.perlmonks.org/   %-- Meister Eckhart


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: adding hash to a hash

2004-09-19 Thread Gunnar Hjalmarsson
Jeff 'japhy' Pinyan wrote:
Gunnar Hjalmarsson said:
Jeff 'japhy' Pinyan wrote:
The general way is:
  # to add %w to %q
  @q{keys %w} = values %w;
If there are overlapping keys, %w's values will be used.
Why not just
%q = (%q, %w);
Benchmark it to see which is better.
The slice method seems to be faster.
use Benchmark 'cmpthese';
my %y = (three => 3, four => 4);
cmpthese -5, {
hashslice => sub {
my %x = (one => 1, two => 2);
@x{ keys %y } = values %y;
},
lists => sub {
my %x = (one => 1, two => 2);
%x = (%x, %y);
},
};
Result:
 Rate lists hashslice
lists 21936/s--  -40%
hashslice 36517/s   66%--
Using %q = (%w, %q) allows you to keep %q's values, though.
And requires less typing. :)
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: adding hash to a hash

2004-09-19 Thread JupiterHost.Net
Thanks for the input! Bit of a brain freeze there ;p
All 3 methods have the desired effect.
Here is the benchmark info for thsoe playing along:
 Benchmark: timing 100 iterations of %q = (%q, %w); , @q{keys %w} =
values %w;, my(%c)=huh(%a,%b);...
 %q = (%q, %w); : 0.459673 wallclock secs ( 0.46 usr +  0.00 sys =  0.46
CPU) @ 2173913.04/s (n=100)
 @q{keys %w} = values %w;: 0.574297 wallclock secs ( 0.63 usr +  0.00 sys
=  0.63 CPU) @ 1587301.59/s (n=100)
 my(%c)=huh(%a,%b);: 0.672142 wallclock secs ( 0.60 usr +  0.00 sys =
0.60 CPU) @ 166.67/s (n=100)
  Rate @q{keys %w} = values %w;
my(%c)=huh(%a,%b); %q = (%q, %w);
 @q{keys %w} = values %w; 1587302/s   --
   -5%-27%
 my(%c)=huh(%a,%b);   167/s   5%
---23%
 %q = (%q, %w);   2173913/s  37%
30%  --
I hope the mail client doesn't butcher it too much :)
Lee.M - JupiterHost.Net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Moving between hashes 2.

2004-09-19 Thread Michael S. Robeson II
Ok, well I think I can see the forest but I have little idea as to what 
is actually going on here. I spent a few hours looking things up and I 
have a general sense of what is actually occurring but I am getting 
lost in the details that were posted in the last digest. See below:

On Sep 19, 2004, at 10:08, [EMAIL PROTECTED] wrote:
I see that you also made use of arrays. It struck me that, since the 
starting point is strings and not lists, using substr() would be more 
straight-forward:

  my %hash3;
  for ( keys %hash1 ) {
while ( my $aa = substr $hash1{$_},0,1,'' ) {
	I have never seen anything like this nor can I find anything in any of 
my Perl books to help me explain what the 0,1 and the " are doing to 
the substr of $hash1. I assume it is position information of some kind? 
If so, what is going on?

  $hash3{$_} .= $aa eq '-' ? '---' : substr $hash2{$_},0,3,'';
	
	This is something new to me. I think I follow your use of the ?: 
pattern feature. However, none of the perl books I have discuss it's 
use in this fashion. So, I am unsure of how you know to do that, or 
rather... how would I have known that I can do that? But basically I 
see that you are looking for '-' and equating it with what is matching 
between the ? and :  (i.e. '---').

	So, as far as I can tell, you are saying: "hey, if you find '-' in $aa 
then append a '---' in $hash3, otherwise append the next three DNA 
letters". However, I do not understand the syntax of how perl is 
actually doing this.

Help with explanation would be greatly appreciated. As you can see I 
can see what the big picture is, it's just that I am unable to 
determine mechanistically how perl is actually going about doing it. 
Also, any online references to the techniques used above would be 
great. I'd look for them myself but I do not know what some of these 
are actually called?

-Thanks so much, I have learned a little just from this much so far.
-mike
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Site management - content deletion stage 1

2004-09-19 Thread Johnstone, Colin
Gidday all,

In our CMS (Interwoven Teamsite) I need to write a content deletion workflow.

If a user is deleting a html page I need to parse that page and report on all assets 
(images, pdfs) attached to the page and delete them as well.

How do I go about doing this? I'll do the legwork just broadbrush the approach.

Any help appreciated
Thank you

Colin



This E-Mail is intended only for the addressee. Its use is limited to that
intended by the author at the time and it is not to be distributed without the
author's consent. Unless otherwise stated, the State of Queensland accepts no
liability for the contents of this E-Mail except where subsequently confirmed in
writing. The opinions expressed in this E-Mail are those of the author and do
not necessarily represent the views of the State of Queensland. This E-Mail is
confidential and may be subject to a claim of legal privilege.

If you have received this E-Mail in error, please notify the author and delete this 
message immediately.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: adding hash to a hash

2004-09-19 Thread JupiterHost.Net
Ok,
I think I've decided to go with 'assign'
1) Because the benchmark difference isn't much:
 splice 2008032/s ---3%
 assign 2074689/s 3% --
2) And duplicate keys become the value of the newest hash on both ways:
 use Data::Dumper;
 my %w = (1=>2,3=>4);
 my %q = (3=>6,7=>8);
 @q{keys %w} = values %w;
 print Dumper \%q;
 %q = (3=>6,7=>8);
 %q = (%q, %w);
 print Dumper \%q;
 $VAR1 = {
   '1' => 2,
   '3' => 4,
   '7' => 8
 };
 $VAR1 = {
   '1' => 2,
   '3' => 4,
   '7' => 8
 };
3) It is less typing :)
Thanks again for all the ideas!
Lee.M - JupiterHost.Net
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Copy folder using Net::FTP

2004-09-19 Thread Roime bin Puniran
I am new in PERL programming...I have one question to ask..How can i transfer a folder 
in 2 different machine using Net::FTP...Now, i can transfer a sigle file between 2 
machine but i am still having problemm to transfer a folder using Net::FTP...Did 
anybony have any idea?Please help me..

This e-mail and any attachments may contain confidential and
privileged information. If you are not the intended recipient,
please notify the sender immediately by return e-mail, delete this
e-mail and destroy any copies. Any dissemination or use of this
information by a person other than the intended recipient is
unauthorized and may be illegal.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Moving between hashes 2.

2004-09-19 Thread Gunnar Hjalmarsson
Michael S. Robeson II wrote:
Ok, well I think I can see the forest but I have little idea as to
what is actually going on here. I spent a few hours looking things
up and I have a general sense of what is actually occurring but I
am getting lost in the details that were posted in the last digest.
Well, before an attempt to explain and/or point you to the applicable
docs, I'd like to change my mind once again. :)  This is my latest
idea:
my %hash3;
for ( keys %hash1 ) {
my $dna = $hash2{$_};
for my $aa ( split //, $hash1{$_} ) {
$hash3{$_} .= $aa eq '-' ? '---' : substr $dna,0,3,'';
}
}
I'll assume that you don't have a problem with the outer loop, that
simply iterates over the hash keys. As a first step in each iteration
I copy the DNA sequence to the $dna variable, so as to not destroying
%hash2.
Over to the 'tricky' part. The inner loop iterates over each character
in the amino-acid sequence data, and respective character is assigned
to $aa. For that I use the split() function:
http://www.perldoc.com/perl5.8.4/pod/func/split.html
  $hash3{$_} .= $aa eq '-' ? '---' : substr $hash2{$_},0,3,'';
This is something new to me. I think I follow your use of the ?:
pattern feature. However, none of the perl books I have discuss
it's use in this fashion.
That sounds strange to me, because that's how it should be used...
Read about the conditional operator in
http://www.perldoc.com/perl5.8.4/pod/perlop.html
OTOH, that notation is basically the same as:
if ( $aa eq '-' ) {
$hash3{$_} .= '---';
} else {
$hash3{$_} .= substr $dna,0,3,'';
}
which is a little more intuitive (at least I think it is).
So, as far as I can tell, you are saying: "hey, if you find '-' in
$aa then append a '---' in $hash3, otherwise append the next three
DNA letters".
Precisely.
However, I do not understand the syntax of how perl is actually
doing this.
Hopefully the if/else statement makes it easier to grasp, and the '.='
operator is used just for appending something to a string.
Finally we have my use of the substr() function.
http://www.perldoc.com/perl5.8.4/pod/func/substr.html
It returns the first three characters in $dna, and since I also pass
the null string as the fourth argument, it changes the content of $dna
at the same time, i.e. it replaces the first three characters with
nothing.
HTH. If you need further explanations, you'll have to ask specific
questions.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: Site management - content deletion stage 1

2004-09-19 Thread perl.org
On Mon, 20 Sep 2004 12:26:45 +1000, Johnstone, Colin wrote
> Gidday all,
> 
> In our CMS (Interwoven Teamsite) I need to write a content deletion 
workflow.

Typically a job (workflow) variable is set to indicate all files associated 
with the joy should be "deleted", maybe using a checkbox on the job 
instantiation form.  Consider renaming the DCRs instead of deleting them so 
users can get back to the data, see history and restore lost content more 
easily.

> If a user is deleting a html page I need to parse that page and 
> report on all assets (images, pdfs) attached to the page and delete 
> them as well.

There are HTML parser modules, but what if something else references one of 
those assets?  Review becomes important before deleting the files.  A link 
check could also be important, but you also might not want to actually 
delete the files from TeamSite until the very end, so you may need to deploy 
a file list from an empty directory to delete the files from a "staging" 
environment before running link scan.  If you are generating emails with CCI 
links, check the variable and put "WARNING" in the subject line.

> How do I go about doing this? I'll do the legwork just broadbrush 
> the approach.

You probably want an externaltask before approval that parses 
all .htm, .html, etc. files for img, href, etc. references, attaching each 
to the task.  If those assets could be in another branch, that really 
complicates things as each task can only be associated with one area and you 
need a tasks for each area, or externaltask logic that knows about the other 
areas.  You may need some special submittask options to ensure the deletions 
are committed (I usually implement submit as externalltask) and OpenDeploy 
configuration to support deletion.  If you are using DataDeploy there are 
probably additional considerations.

Thing modularization.  Interwoven has tools representing job task; use the 
method for retrieving the list of files associated with that and any actions 
available for adding files, etc.  Subclass these if the behaviours you need 
aren't provided; this generally involves calling the Command Line Tools.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Copy folder using Net::FTP

2004-09-19 Thread Chris Devers
On Mon, 20 Sep 2004, Roime bin Puniran wrote:

> I am new in PERL programming...

Okay -- it's "Perl" for the language, "perl" for the program that runs 
programs written in the language, and "PERL" for nothing. In spite of 
what some of the docs jokingly say, "Perl" doesn't stand for anything, 
so it shouldn't be capitalized as if it's an acronym.

> I have one question to ask..How can i transfer a folder in 2 different 
> machine using Net::FTP...Now, i can transfer a sigle file between 2 
> machine but i am still having problemm to transfer a folder using 
> Net::FTP...Did anybony have any idea?Please help me..

Would making a tarball out of it be an option?

That's the old-fashioned but proven way to send directories full of 
files around: make a tarball (`tar -cvf files.tar dir/`), send it to the 
remote machine, then unpack it (`tar -zxv files.tar`).

If you're on Windows, a zip archive is roughly equivalent, but I'm not 
sure how that could be driven from Perl (I'm sure it could be done, I 
just don't know what way makes sense). On the other hand, Archive::Tar 
should be able to do it nicely:


 

-- 
Chris Devers

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Perl_parse() - bus error.

2004-09-19 Thread rajesh.banda

static PerlInterpreter *perlInterpreter = 0;

void Analyzer_i::CreatePerlInterpreter()
{
perlInterpreter = perl_alloc();
perl_construct(perlInterpreter);

const char * persLoader =
"/opt/blasoss/uma/umatkt/tktsni/lbin/persistent.pl";
char* embedding[] = {"", (char *) persLoader};
int exitstatus = perl_parse(perlInterpreter,
xs_init,
2,
embedding,
NULL
);


Regards,
Rajesh
-Original Message-
From: perl.org [mailto:[EMAIL PROTECTED]
Sent: Monday, September 20, 2004 8:55 AM
To: [EMAIL PROTECTED]
Subject: Re: Site management - content deletion stage 1


On Mon, 20 Sep 2004 12:26:45 +1000, Johnstone, Colin wrote
> Gidday all,
>
> In our CMS (Interwoven Teamsite) I need to write a content deletion
workflow.

Typically a job (workflow) variable is set to indicate all files
associated
with the joy should be "deleted", maybe using a checkbox on the job
instantiation form.  Consider renaming the DCRs instead of deleting them
so
users can get back to the data, see history and restore lost content
more
easily.

> If a user is deleting a html page I need to parse that page and
> report on all assets (images, pdfs) attached to the page and delete
> them as well.

There are HTML parser modules, but what if something else references one
of
those assets?  Review becomes important before deleting the files.  A
link
check could also be important, but you also might not want to actually
delete the files from TeamSite until the very end, so you may need to
deploy
a file list from an empty directory to delete the files from a "staging"

environment before running link scan.  If you are generating emails with
CCI
links, check the variable and put "WARNING" in the subject line.

> How do I go about doing this? I'll do the legwork just broadbrush
> the approach.

You probably want an externaltask before approval that parses
all .htm, .html, etc. files for img, href, etc. references, attaching
each
to the task.  If those assets could be in another branch, that really
complicates things as each task can only be associated with one area and
you
need a tasks for each area, or externaltask logic that knows about the
other
areas.  You may need some special submittask options to ensure the
deletions
are committed (I usually implement submit as externalltask) and
OpenDeploy
configuration to support deletion.  If you are using DataDeploy there
are
probably additional considerations.

Thing modularization.  Interwoven has tools representing job task; use
the
method for retrieving the list of files associated with that and any
actions
available for adding files, etc.  Subclass these if the behaviours you
need
aren't provided; this generally involves calling the Command Line Tools.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 





Confidentiality Notice

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Copy folder using Net::FTP

2004-09-19 Thread Roime bin Puniran
Thanks for ur reply..Actually, i need to transfer a folder that continously updated. 
It's so difficult to tarball a directory first then send it through Net::FTP while the 
content of the directory always updated...I mean my problem is, i need to transfer a 
folder without tarball it first using Net::SFTP..I hope i make it clear...

However, thanks Chris following ur advice


-Original Message-
From:   Chris Devers [mailto:[EMAIL PROTECTED]
Sent:   Mon 9/20/2004 1:26 PM
To: Roime bin Puniran
Cc: Perl Beginners List
Subject:Re: Copy folder using Net::FTP
On Mon, 20 Sep 2004, Roime bin Puniran wrote:

> I am new in PERL programming...

Okay -- it's "Perl" for the language, "perl" for the program that runs 
programs written in the language, and "PERL" for nothing. In spite of 
what some of the docs jokingly say, "Perl" doesn't stand for anything, 
so it shouldn't be capitalized as if it's an acronym.

> I have one question to ask..How can i transfer a folder in 2 different 
> machine using Net::FTP...Now, i can transfer a sigle file between 2 
> machine but i am still having problemm to transfer a folder using 
> Net::FTP...Did anybony have any idea?Please help me..

Would making a tarball out of it be an option?

That's the old-fashioned but proven way to send directories full of 
files around: make a tarball (`tar -cvf files.tar dir/`), send it to the 
remote machine, then unpack it (`tar -zxv files.tar`).

If you're on Windows, a zip archive is roughly equivalent, but I'm not 
sure how that could be driven from Perl (I'm sure it could be done, I 
just don't know what way makes sense). On the other hand, Archive::Tar 
should be able to do it nicely:


 

-- 
Chris Devers





This e-mail and any attachments may contain confidential and
privileged information. If you are not the intended recipient,
please notify the sender immediately by return e-mail, delete this
e-mail and destroy any copies. Any dissemination or use of this
information by a person other than the intended recipient is
unauthorized and may be illegal.
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]