On Wednesday 21 March 2007 00:34, Dukelow, Don wrote:
and this works. But every other language I've programmed in anything
dividing with / you only get the hole number why?
That's because you've only used languages that aren't a very good abstraction
of the underlying machine. Many common
On Wednesday 03 January 2007 21:02, Michael Alipio wrote:
#!/bin/sh
for i in /myfolder/ft* ; do ln -s ${i} ./; done
But what it did was to create a symbolic link ft* pointing to
/myfolder/ft*...
Not perl, but:
for i in /myfolder/ft* ; do ln -s ${i}; done
should do it, if I read you right.
Hi, I have a small XML-RPC server I wrote using the RPC::XML::Server module,
however I found that if a single task given to it takes some time, then it
prevents any more requests from happening. I'd like to have each task started
in its own thread (preferably with the ability to specify an
On Sunday 12 November 2006 13:17, 辉 王 wrote:
I can make my program do its job at last, but it runs slowly.
Can anybody tell me how to improve the running speed of this
program? Thanks.
Have you had a look with the Perl profiler to see which bits are going slow.
That way you know to look at
On Monday 23 October 2006 12:37, chen li wrote:
my $file_name='OT-q1.001';
if ($file_name=~/(OT)*.(\d+$)/){
Maybe you mean:
if ($file_name=~/^OT.*\.(\d+$)/){
--
Robin [EMAIL PROTECTED] JabberID: [EMAIL PROTECTED]
Hostes alienigeni me abduxerunt. Qui annus est?
PGP Key 0xA99CEB6D = 5957 6D23
That program I was talking about the other day, well, I've made it
multithreaded to gain the benefit of my dual-core machine, however now I
can't run the profiler with it. This happens:
$ perl -d:DProf scr/analyse.pl -m scr/user_mean.pm
panic: Devel::DProf inconsistent subroutine return
at
I have a section of a program that is this:
my $users = get_all_users();
foreach my $user (@$users) {
my $details = get_user_details($user);
my $sum=0;
my $count=0;
for (my $i=1; $i@$details; $i+=2) {
On Thursday 12 October 2006 23:52, John W. Krahn wrote:
Write it in C. :-)
Tempting, but I'm prototyping here. Perl is much faster to write than C,
especially when dealing with complex data structures (for the more complex
algorithms I'm playing with, some of them would be downright painful
On Thursday 12 October 2006 23:47, Paul Johnson wrote:
Not really a beginners topic, but ...
Hmm, is there a more appropriate list? I just posted here because I've been
subscribed since I started learning perl, quite some time ago :)
In general, perl ops are expensive. Assuming you have
I have the following to open a database:
my $dbh = DBI-connect(DBI:$dbconn, $dbuser, $dbpass) or
die Couldn't connect to db $dbconn: . DBI-errstr;
and then later I'm doing:
my $query=select user_id, preference from $opt{table};
$sth = $dbh-prepare($query);
print
On Saturday 07 October 2006 23:28, Mumia W. wrote:
Use a LIMIT clause to restrict the number of records that are returned,
e.g.:
SELECT id, first_name from users LIMIT 100, 200;
...returns records 100 through 200 of the results.
You would use LIMIT to process the data page by page.
My
On Sunday 08 October 2006 03:05, Rob Dixon wrote:
Well I wouldn't expect it: MySQL is usually good about this sort of thing.
That was what I thought, too.
Exactly what sort of 'issues' is it causing? And are they on the machine
your database server is running on or on the client?
The issue is
On Sunday 08 October 2006 13:51, Ken Foskey wrote:
I killed my update script with the DBI and it left the DB2 connection
hanging so I could not rerun until the DBA killed the thread the next
working day.
Was it a long-running operation? I've found that if you issue a command that
takes a long
On Thursday 21 September 2006 12:18, Ricardo SIGNES wrote:
$; - dollar semicolon'
In my head, I pronounce these ones as 'string-semicolon', but that's a
throwback to when I was young, stupid, and coded in BASIC...
--
Robin [EMAIL PROTECTED] JabberID: [EMAIL PROTECTED]
Hostes alienigeni
Hi, I'd like to download a file using HTTP, however instead of getting the
result as an in-memory string, or saved to a file, I'd like to be able to
access the content like it was a file (this is because the content downloaded
is being written directly to another program as it is downloaded). I
On Tuesday 12 September 2006 08:17, Rob Dixon wrote:
One you have downloaded the remote file to memory or to local file storage
you can then open either of them and access them through a filehandle. Will
that do?
Tell us a little more and we may be able to help better.
Imagine I'm downloading
On Tuesday 12 September 2006 05:48, Tom Phoenix wrote:
If it's a large amount of data and you want to process it a line at a
time, say, it should be easy to write your own buffer-handling code.
Is that what you want to do?
Yes, however I'm accessing the data via HTTP, and so I'd really like to
On Tuesday 12 September 2006 10:27, Rob Dixon wrote:
I think so Robin, thanks. But I'm still not clear whether you really need
to retrieve the data through a filehandle; surely any suitable means of IPC
will do?
Well yes, any IPC thing would do. However, I figured that handles represent
OK, I figured it out. For anyone interested, the solution is to change:
$R-send(qq`x - c(1,2,3) \n shapiro.test (x)`);
to
$R-send(qq`x - c(1,2,3) \n out - shapiro.test (x) \n print (out)`);
Which then gives you the result as it should.
--
Robin [EMAIL PROTECTED] JabberID: [EMAIL PROTECTED]
On Sunday 02 April 2006 02:57, Frank Bax wrote:
At the moment, the array is left unsorted. If I use a sorted array, it
needs to resorted every time a worst entry is replaced by a new
entry. Can I avoid sorting the array every iteration?
Have you considered using a data structure that is
On Sunday 12 March 2006 18:22, Shawn Corey wrote:
Believe it or not, write the number as a string.
for ( '000' .. '100' ){
print $_\n;
}
Note that if you have a string such as 000, you can treat it like a
number:
my $a = '000';
$a++;
print $a\n;
This will print '001'.
To have it go to 4
On Mon, May 10, 2004 at 08:35:53AM -0600, Wiggins d Anconia wrote:
There is a directory watching component in POE or you could grow your
There is also the FAM daemon, which taps into the kernel to do it. I'm
sure that there is a perl module to talk to that.
--
Robin [EMAIL PROTECTED]
On Mon, May 10, 2004 at 12:23:44PM -0400, Paul D. Kraus wrote:
The only problem is thats kind of lengthy i would like to have a
script wrap my script that would have the mutt command built into it.
Or just bind a button to it in ~/.muttrc, so that mutt does all the hard
work.
--
Robin [EMAIL
On Mon, Apr 26, 2004 at 09:32:47PM -0700, Bryan Harris wrote:
It does, Rob, thanks! This belongs on a very helpful perl code page
somewhere.
I've begun one at http://www.kallisti.net.nz/PerlTips
feel free to add it (it's a wiki).
--
Robin [EMAIL PROTECTED] JabberID: [EMAIL
On Tue, Apr 06, 2004 at 04:21:16PM -0500, Ananda Stevens wrote:
So...what book(s) would you suggest for the relative newbie with a clue?
When I wanted to learn Perl, I could only afford one book, so I got 'The
Perl Programming Language'. It was OK to learn from given I had plenty
of experience in
On Wed, Apr 07, 2004 at 01:32:23PM +0200, [EMAIL PROTECTED] wrote:
Where did you learn to use strict ???
I don't remember, I think it may have been from lurking on this list.
Basically from what I've found, if strict gives you errors, then you are
doing something wrong, or at least unusual and
On Wed, Mar 31, 2004 at 11:58:58PM -0700, Bryan Harris wrote:
=) I was referring to a socket. I couldn't think of any place where I
might need to use one.
As an example, I have a neural network system I made in Java. It accepts
commands over a network socket. I then have a Perl program
On Mon, Mar 22, 2004 at 11:15:36AM +0100, [EMAIL PROTECTED] wrote:
I'm working in a project that shall have +- the time of the Internet has we
now it today.
Umm...what does that mean?
Sometimes my script throw a die and I just know the line where was throw.
What I want is to have the all
Hey, I have a problem that I know is possible, because I have solved it
before. However, the computer died and I lost my solution, and can't
work it out again :)
What I want to do is pass a couple of array references into a function
and have it modify the contents of the reference.
What I have
On Tue, Mar 16, 2004 at 08:36:39PM -0500, Wiggins d'Anconia wrote:
Because you are passing in references you want to catch them into
scalars, then to update the values of the references you dereference
them in your push, so...
my ($potUp, $potDn) = @_;
Had tried this...
push @$potUp,
On Tue, Mar 09, 2004 at 08:57:45PM +1300, Robin Sheat wrote:
I was looking through my archives of the list for someone the other day.
I knew it was in there, but had no idea of the subject. If you continue
Err, to clarify...was looking for something that wasn't in a howto, just
something I saw
On Wed, Mar 10, 2004 at 11:30:35AM +1100, David le Blanc wrote:
Can we create a 'how do' keyed on 'problems answered' rather
than 'pure perl'. After all, who reads a 'how to' for something
they are not trying to do at the time :-)
I started my own for my own problems at:
On Sun, Mar 07, 2004 at 12:41:18AM +, Angie Ahl wrote:
However I get them now. And for any other newbies out there... go look
up references right now... really.
In my case it was references and lists-vs-arrays (and how hashes fit
into all this) that caught me. The moment they both had
On Mon, Mar 08, 2004 at 09:53:26PM -0500, Luinrandir Hernsen wrote:
Do I keep one big file with all the info..
of several little files..
which is better?
I assume you are referring to perl CGI or something are you? If so, I'd
suggest looking into using a database and designing an appropriate
On Tue, Mar 09, 2004 at 01:54:29AM -0500, WC -Sx- Jones wrote:
I agree - so I am totally talked out of the 'how to' thread.
Oh :( I kinda liked them. It meant that if I knew I wanted to do
something, and I knew that there was a how-to out there, I also knew
they would have a meaningful subject
On Sat, Feb 14, 2004 at 03:44:38AM -0500, Jeff 'japhy' Pinyan wrote:
Yes, use wantarray().
Aha! Thanks :)
--
Robin [EMAIL PROTECTED] JabberID: [EMAIL PROTECTED]
Hostes alienigeni me abduxerunt. Qui annus est?
PGP Key 0x776DB663 Fingerprint=DD10 5C62 1E29 A385 9866 0853 CD38
On Fri, Feb 13, 2004 at 04:27:08PM +1300, Robin Sheat wrote:
Hey there, what is the best way of including a Perl so that the contents
of it override the existing variables. For example, I have:
With all the help of those who replied ;) I worked it out. For the
benefit of others:
my $comment
Hey there,
I have a set of functions that send an XML element, wait for a response,
parse the response, and return it. However, there are often cases where
the resulting XML is never used, and so parsing it is pointless. Is
there a way that a sub can tell where the result is going to go, so
On Sat, Feb 14, 2004 at 08:19:20AM +0100, wolf blaum wrote:
If you are asking how to teel between:
$var=sub;
and
sub;
Pretty much, from the point of view of sub.
However, there is a way to tell who asked for the result:
read perldoc -f caller
Not really what I want.
but why dont you pass
Hey there, what is the best way of including a Perl so that the contents
of it override the existing variables. For example, I have:
main Perl program
...
my $comment = Default\n;
my $resDir = results;
...
if (@ARGV) {
my $c = shift;
$config = testing/$c.pm;
unless (my $ret = do
On Sun, Feb 01, 2004 at 10:50:44AM -0800, R. Joseph Newton wrote:
what things really mean than you would have with the extra typing [hint--most
editors have excellent copy-and-paste facilities for moving identifiers around]
To extend this a touch, just because of the number of people I've seen
On Sat, Jan 31, 2004 at 08:51:00AM -0500, Joel wrote:
What I meant about the command prompt was Are all the command prompts the
same? Also, could running the Activeperl software damage my system at all
since it is using a command prompt?
Hmm, it looks like you have been told the whole 'the
On Fri, Jan 30, 2004 at 10:33:27AM -0500, Jeff 'japhy' Pinyan wrote:
sub array_diff {
my ($first, $second) = @_;
my %diff = map { @$_ = 1 } @$second;
return [ map !$diff{@$_}, @$first ];
}
amended to:
return [ grep !$diff{@$_}, @$first ];
(for the benefit of anyone else
On Fri, Jan 30, 2004 at 07:48:35AM -0700, Wiggins d Anconia wrote:
Going to need more info about what you think this looks like it should
do, because I (and maybe others here) lack the math skills to get your
answer, funny, I got [9,8,7].
Thats what I get for not profraedinng, the result should
On Fri, Jan 30, 2004 at 07:40:06AM -0700, Wiggins d Anconia wrote:
immediately if all of the needed options have been passed in. Second,
for your triples I would use array references, and for the set of 3
triples I would use an array reference as well. So my call looks like,
I looked at this
On Fri, Jan 30, 2004 at 10:33:27AM -0500, Jeff 'japhy' Pinyan wrote:
Well, that only works if $a[0] is [1,2,3] and $b[1] is $a[0] -- that is,
the EXACT SAME reference. It won't work if $b[1] is its own [1,2,3].
Hmm, right. Not so good. I had thought of that, and thought I tested it
in that
I have a function that takes a fairly complex set of arguments, and am
wondering if there is a better way of doing this than the way I have
done. A call to the function, as I have it, looks like:
$network-potentiateWeights('network',1,(0,0,0,
1,2,3,
Hey there, what is a nice way of doing what this looks like it should
do:
@a=([1,2,3],[5,5,5],[9,8,7]);
@b=([5,5,5],[1,2,3]);
@[EMAIL PROTECTED]@b;
and have @c == ([1,2,3]);
Is there a good way of doing this? (I've tried the obvious things on the
command line, to no avail). I could probably
On Fri, Jan 30, 2004 at 01:17:38PM +0800, Boon Chong Ang wrote:
Just say I want to sort the row by using the fifth column data as
reference from the smallest the largest number, if using sort,
In perldoc -f sort:
sort SUBNAME LIST
sort BLOCK LIST
so you need to either write a sub
On Thu, Jan 29, 2004 at 09:17:31PM -0800, R. Joseph Newton wrote:
Learn Perl, then apply it to real-world problems.
Forgive me drifting topic a little, but I disagree to an extent here. I
learnt perl by applying to real world problems. The first being a
data-mining application, the second being
On Wed, Jan 21, 2004 at 11:49:53PM -0500, Lone Wolf wrote:
I am in dire need of a script that will upload everything from one
server to another one that I can cron. Right now I have to do it by
hand and with more and more updates being done to the site, I need a way
While not a Perl solution,
I have a method 'getNetwork' that returns a hash. I can quite happily
go:
%reply = $network-getNetworkError('net','data','data2');
my $baseErr = $reply{error};
however, I can't go:
my $baseErr = $network-getNetworkError('net','data','data2')-{error};
nor:
my $baseErr =
Hey there, I'm not a total beginner to Perl, but am far enough into it
to have a lot of questions, so I hope this is a suitable place for them
:)
My current one is this. I have a method:
sub getResponse {
my $self = shift;
my $fh = $self-{filehandle};
my $incoming = $fh;
...
On Wed, Jan 21, 2004 at 12:40:39AM -0500, Steve Grazzini wrote:
But you have a syntax error as well, because the hash-dereference
$self-{filehandle}
^..^
Ahh, I didn't notice that at all, I was wondering why it was complaining
about it...shoulda twigged :)
You've already found
54 matches
Mail list logo