Hello,
I have a file say /a/b/c/file in my host. I want to create a file on remote host in directory say dest. Now the question is, how do I create a file in remote host as /dest/a/b/c/d/file using perl script and using ssh. Any idea how do I create directories in script.?
Thanks.
...
I just built Rakudo and Parrot so that I could play with it and get started on learning Perl 6. I downloaded the Perl 6 book and happily typed in the first demo program (the tennis tournament example).
When I try to run the program, I get an error:
Divide by zero
current instr.: '' pc -1 ((unknown file):-1)
I have my perl6 binary in...
Background:
I grew up on using Perl/Python/Ruby for sysadmin-type tasks and shell scripting. I always avoided Bash scripting whenever I needed anything programmer-ish, like functions, looping or control structures. Back then, I could pick my favorite tool for whatever the job.
Problem:
Now I am working in a situation where the preferr...
Hi,
I have a list of files on host machine say in directory /src/.
The directory has more subdirectories. now this directory is copied onto remote machine after mounting. Now the files are preset in remote machine in directory /dst.
Example. If I had /src/a/f1, /src/b/f2
I will have on remote machine /dst/a/f1 ,/dst/b/f2
Now I only ha...
What is a good way in Perl to split a line into pieces of varying length, when there is no delimiter I can use. My data is organized by column length, so the first variable is in positions 1-4, the second variable is positions 5-15, etc. There are many variables each with different lengths.
Put another way, is there some way to use the ...
Hello,
I have a script in remote host which I run as ./test /a/b/c/f and it runs perfectly fine on the maching.
Now I am on host machine, I run the same script as ssh root@dst "./test /a/b/c/f" and this too runs fine.
But from my perl script I execute it using backticks as
$file = "/a/b/c/f";
`ssh root\@dst "./test $file"`;
or
sys...
May you convert this tiny code to Bash code :
user/bin/perl
sleep(300);
system("killall -9 perl &");
sleep(5)
Thanks in Advance .
...
Just as the title asks: are there any XML pull parser implementations in a Perl library?
I looked at XML::TokeParser, but it's nine years old! I'm sure there's something out there that is functional?
...
Hello,
I am relearning Perl after about 10 years of non use.
I did a copy and paste of the two scripts below from one of the answers for a similar question on this site. I have checked and double checked the 'path' and tried several deviations, but I still get the same answer -'The system cannot find the path specified'. Any help would...
I am trying to communicate with a modbus slave via either modbusTCP or modbus serial. The manuf. (partlow) has an ASCII communications manual (http://www.partlow.com/uploadedFiles/Downloads/1160%20ASCII%20Comms%20Manual.pdf) which, looks like it differs from the standard communication methods (http://en.wikipedia.org/wiki/Modbus). A lot ...
How do I define a secondary ordering to the Heap::Simple interface in Perl?
...
I'd like to be able to identify patterns of the form
28°44'30"N., 33°12'36"E.
Here's what I have so far:
use utf8;
qr{
(?:
\d{1,3} \s* ° \s*
\d{1,2} \s* ' \s*
\d{1,2} \s* " \s*
[ENSW] \s* \.?
\s* ,? \s*
){2}
}x;
Needless to say, this doesn't match. Does it have anything to do with the...
Hi,
A while ago I found a library that allowed calling individual built-in Perl functions in C++, I cannot find it now.
Can you tell me where I can find it on the net?
Thanks.
...
use Data::Dumper;
%hash = (
Key => {test => [[testvalue, 10], [testvalue, 20]]},
Key2 => {test => [[testvalue, 30], [testvalue, 40]]},
);
my $parm = $hash{Key}{test};
foreach my $test_p (@{$parm}) {
print Dumper $test_p;
}
It is not displaying in the way I expect.
...
Im playing around with perl6 lately and was searching for a project similar to cpan. I found cpan6 but i think there is no perl6 code yet.
So im looking for some alternative that does not necessarily aim to be a long term solution but is capable to maintain modules and is written in perl6.
As rakudo development goes it might be possibl...
How can I use Getopt::Long method if the input command execution is like this:
$ testcmd -option check ARG1 ARG2 ARG3
or
$ testcmd ARG1 ARG2 ARG3
...
I'm trying to figure out how to read the META-INF/MANIFEST.MF file form a java jar file in perl. I'm attempting to use Mail::Header in order to separate the properties in the manifest. This works fine if the manifest file is already extracted from the jar, but I'm trying to figure out how to extract the manifest into memory and then imme...
I have the following Java code
fun(GUIBundle.getString("Key1"), GUIBundle.getString("Key2"));
I use Perl to parse the source code, to see whether "Key1" and "Key2" is found within $gui_bundle.
while (my $line = <FILE>) {
$line_number++;
if ($line =~ /^#/) {
next;
}
chomp $line;
if ($line =~ /GUIBundle\.ge...
My usual 'x' usage was :
print("#" x 78, "\n");
Which concatenates 78 times the string "#". But recently I came across this code:
while (<>) { print if m{^a}x }
Which prints every line of input starting with an 'a'. I understand the regexp matching part (m{^a}), but I really don't see what that 'x' is doing here.
Any explanation w...
Hi,
I am trying to convert a folder of tif files to jpeg so they can be displayed on my website. my current approach is not working. i wrote a perl script with
#!/usr/bin/perl
opendir(DIR, $ARGV[0]);
@files = readdir(DIR);
closedir(DIR);
foreach $file (@files){
if($file =~ /(.*?)\.tif/){
print "converting $file\n";
`convert -au...