I should add there is probably cleaner way to do this, but this was quick and simple and I'm on 5 hours sleep :)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong...
The problem is you are used to have a page file (or tmpfs if linux/unix) and that helps supplement your ram (or lack of). When you go to a VPS they disable page/tmpfs because they don't want people under buying ram and over utilizing the disk. You can run a basic linux box in 512M of ram but...
I will say that either coloing your own server or getting a virtual private server is the way to go. You have to handle your own security and updates, but I prefer it that way. I had a VPS with burst.net for a few years (I think cost was $60 per year) and only moved it because I had my own...
Assuming they are remote and you don't aren't running perl where they are stored locally?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
would it be easier to just use -exec and cp? But I guess I'm assuming he doesn't want to keep the sub directory structure and just dumps them all into new dir?
Just a thought :) I have never used cpio and had to man it to see what -pd did so I could understand your solution...
on Linux just use find
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
Thanks.. I was struggling with that one for a bit, I figured I could figure out a split that would pick up the word before the : and then everything up to the word before the next :, but it was just killing me.... your seems so simple :)
Thanks!!!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
id:2 name:test1 longname:test2 with space longname description:here is my description.id:10 name:test3 longname:test 4 long name description:a discription of test 5
I have data like above and I'd like to get it into a hash like
%hash { 'id:2' =>
{name => test1
longname => test2 with space...
I would also wrap the whole think in a alarm, and when the alarm hits you could issue your stopftp command.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong...
Thank you!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
I have a regex written like this and it works fine
$data = '01:16:43.7';
($cdr{dhour}, $cdr{dmin}, $cdr{dsec}, $cdr{dfsec}) = $data =~ /(.*):(.*):(.*)(\..*)/;
print "H:$cdr{dhour}\n";
print "M:$cdr{dmin}\n";
print "S:$cdr{dsec}\n";
print "fs:$cdr{dfsec}\n";
output:
H:01
M:16
S:43
fs:.7
but...
$log->read("/Dump/m1.pcap");
does not look like it is on your desktop. You will have to deal with the spaces in windows files name, I suggest just keeping in a directory with no no spaces c:/blah/m1.pcap and reading it in like that "c:/blah/m1.pcap"...
You will also have problems when people click the stop button, or the browser crashes, or their connection has a hiccup.
I suggest taking the form values and storing them somewhere and assign a job ID (epoch? auto increment in a db?) and a status. Then have a local job running (cron, daemon...
I should add I found this to be a very good solution for some of my problems. I am creating data in a file to bulk load into mysql, so I was reading a file, writing it to another file, reading that file into SQL. A lot of disk read/writes.
I moved it to read a file, write to /dev/shm, and...
On Unix/Linux? You can use /dev/shm
http://www.cyberciti.biz/tips/what-is-devshm-and-its-practical-usage.html
Travis
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the...
or you could do this which works for any number
my %option = ( 2 => [a,b,c], 3 => [d,e,f]);
my $isnum = '2';
for (@{$option{$isnum}}) {
print "X:$_\n";
}
if you really want switches
http://perldoc.perl.org/Switch.html
but I've never used them.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
If you only have 2 options
my @letters = $inum == 2 ? (a,b,c) : ( d,e,f)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
There are memory links related to par compiling and hashs/hash refs (I can't find where I read that at but I had the same problem). I ended up writing a wrapper program that calls my code (per pdf, kinda doing the same thing), and then all memory gets released back to the programs as the...
Any reason you didn't just Text::CSV?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.