comp.lang.perl.misc
  Home FAQ Contact Sign in
comp.lang.perl.misc only
 
Advanced search
January 2008
motuwethfrsasuw
 123456 1
78910111213 2
14151617181920 3
21222324252627 4
28293031    5
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.perl.misc Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Thinking of your next holiday         


Author: rathnepal
Date: Jan 17, 2008 21:57

Are you planning for vacation, holiday?
We would like you to spare your valuable time!
Visit our website www.magical-nepal.com for information on Nepal,
Tibet and Bhutan.

Thanking you in advance visiting and look forward to assist you.

Regards,

Rath Nepal Tours and Travels
P O Box 10691, 2nd Floor Mountain Plaza
Tel: 977-1-4268948, 4258141, 4264512
Fax: 977-1-4264512
E-mail: sales@magical-nepal.com
website: www.magical-nepal.com
no comments
  Making variable field names         


Author: Peter Jamieson
Date: Jan 17, 2008 20:09

I have many tables of results, a sample record looks like as below
in my code together with fields in the db.

The problem is this. Not every table I receive has the same fields.
Sometimes there are fields, "test4", "test5" for example.There is always
a fixed number of 7 fields.

Is it possible to have my code change the INSERT INTO statement so that the
fields change
depending on the fields in each table?....of course the db will have all
possible fields
included.
In other words, can the field names be variables?...if so what is the syntax
for this?

Any help appreciated!

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

use Win32::ODBC;
use dbi;
Show full article (1.32Kb)
2 Comments
  Re: Help: Login FTP         


Author: Tad J McClellan
Date: Jan 17, 2008 15:31

Amy Lee gmail.com> wrote:
> On Thu, 17 Jan 2008 16:22:18 +0100, Peter Ludikovsky wrote:
>
>> 1) Go to http://search.cpan.org/
>> 2) In the textbox enter "FTP"
>> 3) Click on the first result
>> 4) Read & meditate
> Thanks your advice. However I've done this before I posted this article.
> There are so many modules about FTP, I can't find what actually I need. So
> could you tell me more details?

You appear to not have followed step 3...

--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
no comments
  Re: Shrink large file according to REG_EXP         


Author: Ilya Zakharevich
Date: Jan 17, 2008 14:52

[A complimentary Cc of this posting was sent to
Uri Guttman
stemsystems.com>], who wrote in article mail.sysarch.com>:
> In versions 5.6 and later, Perl won't recompile the regular expression
> if the variable hasn't changed, so you probably don't need the /o
> option. It doesn't hurt, but it doesn't help either.

Yet another case of broken documentation. Still, //o helps (though
nowhere as dramatically as before). It avoids CHECKING that the
pattern did not change.

Hope this helps,
Ilya
1 Comment
  Re: Shrink large file according to REG_EXP         


Author: comp.llang.perl.moderated
Date: Jan 17, 2008 12:59

On Jan 16, 9:28 am, thellper gmail.com> wrote:
> Hello,
> I've a problem to solve, and I need some help, please.
> I've as input a large text file (up to 5GB) which I need to filter
> according some REG_EXP and then I need to write the filtered
> (hopefully smaller) output to another file.
> The filtering applies row-by-row: a row is splitted according to some
> rules in various pieces, then some of the pieces are checked according
> to some REG_EXP, and if a match is found, the whole line is written to
> the output.
>...

Just a guess but splitting into pieces and then applying the regex
to each piece may well be a signifcant slowdown. Have you considered
trying to tweak the regex to avoid the split and resultant copies...

--
Charles DeRykus
no comments
  To update one file with the another file's data..         


Author: clearguy02
Date: Jan 17, 2008 12:35

Hi,

I have two text files: each one has has four fields (delimited by a
space) on each line: id, group, email and manager_id. First file is a
small file with 50 entries and the second one is a huge file with
5,000 entries. The "id" field is same in both files, but the
manager_id's may be different. By comparing all the entries in the
second file (that has the correct manager id), I need to update the
manager_id field in the first file.

Here is the code, I am thinking of:

-----------------------------------------
open (INPUT1,"smallFile.txt") or die "Cannot open the file: $!";
open (INPUT2,"bigFile.txt") or die "Cannot open the file: $!";

while $line1 ()
{
@small_arr = split /\s+/, $line1;
}
Show full article (1.12Kb)
5 Comments
  FAQ 8.20 How can I call my system's unique C functions from Perl?         


Author: PerlFAQ Server
Date: Jan 17, 2008 12:03

This is an excerpt from the latest version perlfaq8.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

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

8.20: How can I call my system's unique C functions from Perl?

In most cases, you write an external module to do it--see the answer to
"Where can I learn about linking C with Perl? [h2xs, xsubpp]". However,
if the function is a system call, and your system supports syscall(),
you can use the syscall function (documented in perlfunc).

Remember to check the modules that came with your distribution, and CPAN
as well--someone may already have written a module to do it. On Windows,
try Win32::API. On Macs, try Mac::Carbon. If no module has an interface
to the C function, you can inline a bit of C in your Perl source with
Inline::C.

--------------------------------------------------------------------
Show full article (1.64Kb)
no comments
  Re: Help: Login FTP         


Author: Jim Gibson
Date: Jan 17, 2008 10:54

In article <1200583365.481814@nntpcache01.si.eunet.at>, Peter
Ludikovsky gmail.com> wrote:

[top-posting fixed]
> Amy Lee wrote:
>> Hello,
>>
>> I wanna write a script that it can login the FTP server and go to the
>> specific directory to get the file list and download files. But I don't
>> know how to pass the user name part and password part. The FTP server is
>> an anonymous server.
>>
>> My question is: Are there any Perl modules than can help users login FTP
>> without password and user name? Furthermore, which modules can help me get
>> file lists like "ls -l" in FTP server?
> 1) Go to http://search.cpan.org/
> 2) In the textbox enter "FTP"
> 3) Click on the first result
> 4) Read & meditate

... or trying entering 'perldoc -q ftp' at a command-line prompt.
Show full article (1.10Kb)
no comments
  Re: Calling binary from Perl prog and passing arguments         


Author: Jim Gibson
Date: Jan 17, 2008 10:48

In article
<4f375943-9bfe-475b-8a1f-a48f8c42b5b6@j20g2000hsi.googlegroups.com>,
vineet gmail.com> wrote:
Show full article (1.71Kb)
no comments
  Re: Calling binary from Perl prog and passing arguments         


Author: Mark Clements
Date: Jan 17, 2008 10:42

vineet wrote:
> Hi Experts,
>
> I have sql interface which connects to oracle database. When I execute
> sql, it connects to database and give prompt where user can type sql
> statemets to be executed ... some thing like
> $
> $
> $SQL;
>>
>>
>> select * from employee;
> ..............
>
> I wanted to write wrapper script over SQL interface and read a file
> having SQL statement and passed it to SQL interface.
>
> Can you please guide me how to start writing this.
> Thanks,
> VS ...
Show full article (0.64Kb)
no comments
1 2