Jeff,
For ssh or scp not to ask for your password, you must create and exchange
keys. Check out O'Reilly's SSH The Secure Shell.
-Mike
-Original Message-
From: Jeff Liu [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 01, 2002 2:18 PM
To: Lirot, Gregory; Beginners
Subject: RE: scp inside
http://www.wetware.com/drieux/CS/lang/Perl/Beginners/p1_read_p2.txt
On Monday, April 1, 2002, at 02:49 , Roy Peters wrote:
> Hello,
>
> I have 2 independent perl programs p1 and p2. p1 calls p2 (using either
> the
> system() or `` operators, and p2 will print
> out status information every 2 s
Daniel Falkenberg wrote:
>%users = (
> 'username01' => {
> 'Comp01' => '$0.00'
> },
> 'username02' => {
> 'Comp02' => '$0.00'
>},
> 'usename03' => {
> 'Co
G'day All,
Just wondering how I would check the following variable against the hash
below?
sub read_data {
open USER_DATA, "$USER_DATA" or warn "cannot open '$USER_DATA' for
reading: $!\n";
flock(USER_DATA, 2) || warn "Can't lock $USER_DATA exclusively: $!";
while( $USER_DATA= ) {
Hector Moran wrote:
>
> How do you shadow/hide text. For example I have a small perl program
> in which it authenticates at launch to access an application:
>
> print "ENTER USER NAME\n";
> $uname = <>;
> chomp($uname);
> print "\n";
>
> print "ENTER PASSWORD\n";
> $pwd = <>; #WOULD LIKE TO SHA
--- Begin Message ---
Hi all,
How do you shadow/hide text. For example I have a small perl program in which it authenticates at launch to access an application:
print "ENTER USER NAME\n";$uname = <>;
chomp($uname);
print "\n";
print "ENTER PASSWORD\n";
$pwd = <>; #WOULD LIKE TO SHADOW THIS
On Monday 01 April 2002 02:25 pm, [EMAIL PROTECTED] wrote:
> Is there a site freeware site blocking software for IE or netscape. I need
> this for home use.
> My ISP is hawk.com and I pay 9.00 per month.
If you wish to block out sites of questionable content to protect your
children, see "inter
Hello,
I have 2 independent perl programs p1 and p2. p1 calls p2 (using either the
system() or `` operators, and p2 will print
out status information every 2 seconds or so. How do I set it up such
that whenever p2 prints out data, it is printed out by p1 also IN REAL TIME?
Thanks.
=
That's why you need to stop programming on your Palm Pilot. :)
-Original Message-
From: Chas Owens [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 01, 2002 1:33 PM
To: Nikola Janceski
Cc: [EMAIL PROTECTED]
Subject: Style issues (was RE: Increment a Variable)
No offense taken (TMTOWTDI).
> For debugging purposes I like to be able
> to see entire functions (and sometimes
> more than one) on the screen at the same
> time. With short loops like this one that
> means keeping it as short and sweet as
> possible to maximize the amount of code
> visible at one time.
Get a bigger monito
No offense taken (TMTOWTDI). For debugging purposes I like to be able
to see entire functions (and sometimes more than one) on the screen at
the same time. With short loops like this one that means keeping it as
short and sweet as possible to maximize the amount of code visible at
one time. So
Can someone help me decode this? or if not, please
recommend a good reference book or site for my
specific needs! thanks
i wrote this script for use of active perl installed
on win98 and used two modules
#!C:\Perl\bin -w
use HTML::Parse;
use HTML::FormatText;
# My question is here, insofar
Thanks for your help. I finally got it to work.
Allison
-Original Message-
From: drieux [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 01, 2002 3:44 PM
To: [EMAIL PROTECTED]
Subject: Re: Array question
On Monday, April 1, 2002, at 11:11 , Aman Raheja wrote:
> $array-prob.pl
p1: I l
On Monday, April 1, 2002, at 01:03 , Michael Stearman wrote:
> $x="A";
> foreach $list(@list) {
> $cell="$x1";
> $worksheet1->write($cell, $list);
> $x++;
> }
it's a 'scoping' bug - try
$cell = "${x}1";
this will generate your
A1
THANKS I have been
Good call..
use warnings;
use strict;
Too bad it took me 3 years to learn the benefits of using that and making it
a good habit to start all my programs with it.
> -Original Message-
> From: Jonathan E. Paton [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 01, 2002 4:14 PM
> To: [EMAIL
Chas, no personal offense, but that code just looks ugly. I like the way
it's originally written by Mike.
So what version of perl are you using? perl -v
> -Original Message-
> From: Chas Owens [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 01, 2002 4:09 PM
> To: Michael Stearman
> Cc:
Micheal,
try this"
$x = "A";
foreach $list(@list) {
$cell = "$x{1}"; //you can't just put a suffix to a variable when
you print it..perl will think //you mean $x1.. use
$x{whateveryouwanttoadd} for example... $num = 4; print "$sun{th}"; //to
make it 4th
$worksheet->write($cell,
> It could be my code.
It is, trust me.
> I am using the variable to write to an
> Excel file in which I want to increment
> the cell from A1 to B1 to C1, etc.
>
Generalising your code:
> $x="A";
> for (0..3) {
> $cell="$x1";
> print $cell . "\n"
> $x++;
> }
And what do you
On Mon, 2002-04-01 at 16:03, Michael Stearman wrote:
> It could be my code. I am using the variable to write to an Excel file in
> which I want to increment the cell from A1 to B1 to C1, etc.
>
> $x="A";
> foreach $list(@list) {
> $cell="$x1";
> $worksheet1->write($cell, $list);
>
It could be my code. I am using the variable to write to an Excel file in
which I want to increment the cell from A1 to B1 to C1, etc.
$x="A";
foreach $list(@list) {
$cell="$x1";
$worksheet1->write($cell, $list);
$x++;
}
>From: "Michael Stearman" <[EMAIL PROTECTED]>
>T
works for me.
$a = "A";
$a++;
print "$a\n"; # prints B
what version are you using? ++ is magical on letters in ver 5.500?+ I think.
Just remember that -- is not magical on letters, you will always get -1 from
that.
> -Original Message-
> From: Michael Stearman [mailto:[EMAIL PROTECTED]
> I was wondering if anyone knew how to increment a variable when the variable
> is a letter. For example
>
> $x="A";
> $x++;
jep@delta:/ > perl
$x = 'A';
print ++$x . "\n";
B
jep@delta:/ >
Seems to work for me :) Remember the difference between preincrement and
postincrement, and what
happ
On Mon, 2002-04-01 at 15:50, Michael Stearman wrote:
> Hi,
>
> I was wondering if anyone knew how to increment a variable when the variable
> is a letter. For example
>
> $x="A";
> $x++;
>
> doesn't work. I'm trying to get $x="B";
>
> Thanks,
> Mike.
Works for me, perhaps you could post th
Hi,
I was wondering if anyone knew how to increment a variable when the variable
is a letter. For example
$x="A";
$x++;
doesn't work. I'm trying to get $x="B";
Thanks,
Mike.
_
Get your FREE download of MSN Explorer at http:/
On Monday, April 1, 2002, at 11:11 , Aman Raheja wrote:
> $array-prob.pl
p1: I loved the
$field{$_}++;
p2: but since you have stashed it all in a Hash, why not
unpack the hash with
my @arr = keys(%field);
the counter proposal -
http:
Hello,
Is there a site freeware site blocking software for IE or netscape. I need
this for home use.
My ISP is hawk.com and I pay 9.00 per month.
__
William Ampeh (x3939)
Federal Reserve Board
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EM
On Mon, 2002-04-01 at 14:42, Rob Lee wrote:
>
> I'd like to fork my program without waiting for the child to exit.
>
> My child will be a sub with an infinite loop, so I'd like the parent to
> continue on it's merry way.
>
> Solutions?
> -R
If you "fork" without ever waiting on your chil
dr
Thanks, Jonathan, Drieux!
- B
__
> Is it possible to do the reverse of a chmod?
Yes
> To get the permissions of a given file as a number?
Same question twice!
> I'm creating a new file from an old one, and I'd like the new one to have
> the same permissions as the old one.
The beginner shines in me...
For reaping children,
I was thinking of send a signal to the entire group.
The gist is:
I want to attach a child to a FIFO, then have the parent start other
processes that read from the FIFO. The readers must be tricked into
thinking they are reading from files.
perl -MCPAN -e shell
- Original Message -
From: "Sean Hoskin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 01, 2002 11:13 AM
Subject: Equivalent Linux tool to ppm
> Is their a tool similar to ppm for Linux (Unix)?
>
> "You use a Windows machine and the golden rule is:
I'd like to fork my program without waiting for the child to exit.
My child will be a sub with an infinite loop, so I'd like the parent to
continue on it's merry way.
Solutions?
-R
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
> Is their a tool similar to ppm for Linux (Unix)?
Yes, CPAN.pm:
perl -MCPAN -e 'shell'
> [Omitted non-tiny sigblock that entirely dwarfed the
> lonely one line question. Sean, do something about
> it please! My mailbox grows fast enough thanks :/ ]
Jonathan Paton
Sorry, there were a couple typos in my earlier response:
> %count = ();
> foreach $element (@array1) { $count{$element}++ }
I should've included the semicolon at the end of the second line.
> Your array of unique names is now available from the keys of %count;
> the number of occurences of each
Sean,
Although it doesn't quite work the same as ppm, the cpan command will
enable you to install any package you desire. If you've never installed
it before, you'll need to use 'perl -MCPAN -e shell;' from the command
line, following the directions below. I recall hearing/reading that
this comm
my apologies for sending long code illustrations.
in the future I will post them at:
http://www.wetware.com/drieux/CS/lang/Perl/Beginners/
and post up a URL to them.
ciao
drieux
---
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Even, I put it like open(SCP,"scp source dest|"), the system still ask me to
type in my password. Probably, that's another shell, I mean the ssh login
shell is different from the one I run my script. So, I can not send my
password from previous shell to new ssh shell.
Thanks,
Jeff Liu
-Orig
Is their a tool similar to ppm for Linux (Unix)?
"You use a Windows machine and the golden rule is: Save, and save often.
It's scary how people have grown used to the idea that computers are
unreliable when it is not the computer at all - it's the operating system
that just doesn't cut it." - Li
Here's my solution.
There will be shorter ways. I am new to perl, so this is how did it.
At the prompt do
$array-prob.pl
#!/usr/bin/perl
#File name : array-prob.pl
my @arr;
while(<>)
{
chomp($_);
$field{$_}++;
print "$_ $field{$_}\n";
my $set = 0;
my $r
Jeff:
I think you have the | in the wrong place. It should be
at the end of the line, as :
open(SCP,"scp source dest|");
I think there is a way in ssh/scp to set up a similiar thing to
an rhosts. This is one way to be coding a password into a script.
That is the tradeoff of having some host tru
> Is it possible to do the reverse of a chmod?
Yes
> To get the permissions of a given file as a number?
Same question twice!
> I'm creating a new file from an old one, and I'd like the new one to have
> the same permissions as the old one. Is this possible?
Same question trice!
You wanted
Is it possible to do the reverse of a chmod? To get the permissions of a
given file as a number?
I'm creating a new file from an old one, and I'd like the new one to have
the same permissions as the old one. Is this possible?
TIA.
- B
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For addi
On Mon, 1 Apr 2002, Allison Ogle wrote:
> I don't know how long the list is and eventually in the list some of
> the names will repeat. I want to put these names in an array but I
> don't want to repeat any names in the array and I want to keep a count
> of how many times the name appears in the
On Monday, April 1, 2002, at 06:41 AM, David Gray wrote:
> my @fl = grep { $_ ne '.' and $_ ne '..' }, readdir DIR;
no comma after the block.
take a look at the Net::SCP, Expect and Net::SCP::Expect
modules on CPAN.
--
Best Regards,
Daniel [EMAIL PROTECTED]
Monday, April 01, 2002, 6:05:49 PM, Jeff Liu wrote:
> Hi Greg,
> Thanks for your help.
> But I have difficulty to fill in the password. What I like to
STOP SPAMMING ME
--- drieux <[EMAIL PROTECTED]> wrote:
>
> On Monday, April 1, 2002, at 08:15 , Joe Echavarria
> wrote:
>
> that he was having problem with the cgi script -
>
> amongst other things there is no 'start_html' in it
> to make sure that it is set up correctly.
>
> I would propo
You could always put them into a hash and then put them into an array later.
foreach(@names){
$hash{$_} = 1;
}
my @array = keys %hash;
-Original Message-
From: Allison Ogle [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 01, 2002 8:08 AM
To: a a
Subject: Array question
Hi,
I have
sure: I wrote this as a push script to move files from one machine to one or
more machines. This script works best if Keys are exchanged, but will also
work(Prompting for password) without.
Also at http://www.gargiullo.com/scripting/index.cfm
#!/usr/bin/perl -w
##
# Original script wri
On Monday, April 1, 2002, at 08:15 , Joe Echavarria wrote:
that he was having problem with the cgi script -
amongst other things there is no 'start_html' in it
to make sure that it is set up correctly.
I would propose something on the order of the script at
the end, where I would isolate the t
Allison, Check out pages 133 - 135 in Learning Perl (3rd Edition) - the
section "AutoIncrement and Autodecrement" section _ particularly the top of
page 135 has an example for just this very question! I just read that last
week so it popped right up in my mind.
If you don't have the book, h
Hi Greg,
Thanks for your help.
But I have difficulty to fill in the password. What I like to do is,
open (SCP, "| scp source destination");
print SCP scppassword;
close SCP;
Above code does not work for me. Any idea to make it work?
Best regards,
Jeff Liu
-Original Message-
From:
looks like '$login = print $hosts{$hostname};'
is not what you want.
'print' function returns '1' -- not the string it prints.
you want:
$login = $hosts{$hostname};
and if you really want to print the value:
print $login;
On Monday, April 1, 2002, at 08:30 AM, [EMAIL PROTECTED] wrote:
> The pro
Jeff:
Yes. Merely use something like:
system("scp Source Destination");
This would be the easiest way, or, also:
`scp Source Dest`;
More elaborate stuff can be done, but this is good for starters.
Best Regards,
Greg
-Original Message-
From: Jeff Liu [mailto:[EMAIL PROTECTED]]
Sent:
I find that
print "Content-type: text/html\n\n";
doesnt always work. So I just use
print $CGI->header;
Regards,
Agustin Rivera
Webmaster, Pollstar.com / Pollstaronline.com
- Original Message -
From: "Joe Echavarria" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April
Hi all,
Is there a way to do scp inside perl script?
Thanks,
Jeff Liu
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Thanks, Jeff!
- B
__
On Mar 28, Bryan R Harris said:
>- Why is the \1, \2, etc. syntax obsolete? The one thing I love about
>regular expressions is that I can use them within text editors (nedit,
>textpad, bbedit), but none of these support the $1 notation in the replace
>st
The problem I am having is with $full
How do I get $login to return its value when I try to assign this scalar
$full
Thanks in advance
#!/util/perl5.static
$hostname = qx(/usr/ucb/hostname);
chomp $hostname;
%hosts = (
crane => "hourihj",
runner => "paulg",
ice => "roo
Thank you Jenda! I acted defensively in my email response to you.
It's good to know about the 0, I never heard that before.
>I guess it's me how should apologize.
>Your second mail really sounded like you did not read my mail at
>all and I overacted.
>
>For unallowed chars:
>
>1) almost always
Hi there,
When i try to execute the script using the web
browser i get no output from it but at shell prompt it
works.
Here is the script :
#!/usr/bin/perl -w
use CGI qw/:all/;
print "Content-type: text/html\n\n";
print "- LISTA DE LINKS -";
open(LISTA,"links") or die "Error > : $!\n";
o
Hi,
I have a datafile with a list of names like
Ana
John
Mike
Tracy
John
Luke
etc.
I don't know how long the list is and eventually in the list some of the
names will repeat. I want to put these names in an array but I don't want
to repeat any names in the array and I want to keep a count
> if ($filename=~/(\w.\w\w\w.\w)$/)
This will match:
<3 word chars>
You need to escape the .
Jonathan Paton
__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
--
T
I'm trying to figure out how to exclude upload files with 2 periods
at the end (b/c of that virus which I forgot the name of, maybe
nimba?) Anyhow, this is what I have but it doesn't work. When I try
to submit with the double periods the test always results in false
and never gives the error
when i try to excute your code over the brower i get
not output from the script, but when i execute the
script at command line i gets output.
why ?
--- drieux <[EMAIL PROTECTED]> wrote:
>
> On Monday, April 1, 2002, at 07:12 , Joe Echavarria
> wrote:
>
>
>
> > if (param())
> > {
> > $
On Monday, April 1, 2002, at 07:12 , Joe Echavarria wrote:
> if (param())
> {
> $cate= param('categorias');
> print " The Param is ---> es $cate";
> };
> while ($file = ) {
>($categoria,$link) = split(":",$file);
> ##this code is not working
>if ($categoria eq $cate) {
>
On Fri, 2002-03-29 at 23:36, Jim Witte wrote:
>I'm contemplating writing some software to scan through a large volume
> of email (over 95 MB) to identify threads and remove quoted material.
> Does anyone have any good references on algorithms to do text processing
> like this for such a ma
> > What if there is HUNDREDS of items, then
> > it'd be really slow. For a better approach
> > using hashes then see what I did in:
> >
> > http://groups.yahoo.com/group/perl-beginner/message/9583
>
> The question that now comes to mind is why
> not put all of the 'response functions'
> into a P
Good morning,
> So I have modified my script a bit and it works. However, now
> I want to not
> read in the "." and ".." directories. How can I do this?? I am having
> problems with this part.
I usually use the following code to do this:
opendir DIR,'$mydir'
or die "couldn't open dir [$myd
On Sunday, March 31, 2002, at 07:07 , Jonathan E. Paton wrote:
[..]
I had not thought of the SWITCH case being one way or the other
in the OO v. Proceduralists approach - but your proposition does
present the problem - what is the tradeoff between 'runtime performance'
and
maintainability.
>>
Guys,
How can I check if the remote peer closed my TCP connection?
The following code is OK (taken from the book) because it expects something
to come from the peer:
use IO::Socket;
$sock = new IO::Socket::INET (LocalHost => 'goldengate',
Ron wrote:
> For the life of me, I cannot remember how to find the certain numbers in a
> string. I remember how to find the length of an array but I cannot find how
> to find the length of a string in a variable.
perldoc -f length
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For
hi guys,
The following cgi script works just fine when i run it from the command
prompt, but when i check using a browser the output is not displayed...it
gives error as document contained no data..can i use the system() function
in cgi as i have done below? the data itself is not fetched from
For the life of me, I cannot remember how to find the certain numbers in a
string. I remember how to find the length of an array but I cannot find how
to find the length of a string in a variable.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
71 matches
Mail list logo