Hello:
I've long used Perl's "in place edit" feature, and understand it and regex
fairly well, e.g.:
perl -i -p -e "s/oldhostname/newhostname/g" /etc/hosts
However, what is the syntax if I wanted to just process a text stream to
stdout?, e.g.:
cat /etc/hosts | perl "s/in_text/out_text/g"
I'm
Hello:
I'm very excited when I discovered the map function, however, I cannot seem to get it
to do what I want in this instance:
chomp (my @strings = `strings *`);
my $var;
my @ptrRecords = map ((/.*\s+PTR\s+.*/), @strings ); # <- LINE IN QUESTION
foreach (@ptrRecords) { print "$_\n
Hello:
I know I can return multiple scalar values from a subroutine using an array,
but how do I return multiple arrays, hashes, etc from a subroutine? For
example, the following snippet...
my @ip_addresses = &getIPAddresses;
my (@hostfile, @no_dname) = &getHostNames(@ip_addresses);
Hello:
I've been away from the Learning Perl book for a few weeks and trying to refresh
my memory, but I'm stumped. What I need to do is take the output of a command
(ovfiltercheck) that looks something like this:
### BIN OUTPUT BEGIN #
FilterExpressions {
NetBackbone "Netw
Hello:
Try as I might I cannot seem to get the Tk module to install on either Solaris
or NT. As I fought the thing, I think I got the dependencies modules loaded
(i.e., ExtUtils-MakeMaker-6.05.tar.gz, File-Spec-0.82.tar.gz). However, when I
try to install Tk-800.024.tar.gz (tK module), it always
y spring
for a Carl's Jr "$6 dollar burger & Lord of the Rings "The Two Towers" ticket
(all via-Paypal) if anyone has a solid solution.
Thanks,
Lance
-
#!/usr/bin/perl
print "Lance Murray, In
Hello
I'm trying to write a simple script to test if a port is up or down. It all depends
on being able to parse for the word "Connected" in an array. Try as I might, I can't
figure out why the following regex comparison won't work.
if $reply[1] =~ /Connected/ {
The code snippet is as fol