User Profile

Collapse

Profile Sidebar

Collapse
hutch75
hutch75
Last Activity: May 15 '08, 09:24 AM
Joined: Feb 20 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • How to search values in an array & if it matches data in a file, perform an action?

    Question could also be asked, how to compare data between two arrays and perform an action (print cmd) everytime there is a match?

    The problem I'm having with the code below is that the comparison in the conditional IF statement is only happening against the first value --$link-- in the array --@route--

    I want the comparison between the two arrays to repeat for every value in the first array @route.

    ...
    See more | Go to post

  • Thanks for the Response Kevin,

    The Unix Sys Admin showed me the error of my ways. I thought I couldn't run traceroute from the command line because of a permissions issue, when in fact it just needed to be called differently.

    EG, instead of typing: traceroute 72.14.207.99

    I needed to type: /usr/sbin/traceroute 72.14.207.99

    With that being said, was able to design a script to do what...
    See more | Go to post

    Leave a comment:


  • Extract and compile a list of IP addresses after doing a system call of traceroute

    Hi All - chasing down a means to initiate a traceroute, record results, and extract IP addresses in an (array?)

    Here's what I'm thinking about so far, wonder if anyone's been down this road before and can offer advice if I'm going the right direction or not.

    untested - pending permissions to initiate traceroute from server
    Code:
    #!/usr/bin/perl -w
    use strict;
    use warnings;
    use CGI
    ...
    See more | Go to post

  • Thanks KevinADC and SpecialKay.

    Kay, your idea re; using the commas is what sparked the solution.


    In essence...
    [CODE=perl]
    # GPS variable name represents pair of GPS coordinates of unknown and uncontrollable lengths
    $GPS = (-xx.xxxx, xxx.xxxxxxxx)

    # retain GPS variable for use elsewhere, use newGPS variable
    # original GPS format has parantheses ( ) and blank space...
    See more | Go to post
    Last edited by eWish; Apr 7 '08, 03:32 AM. Reason: Please use code tags

    Leave a comment:


  • Hi all,

    Correction to the last, the correct IF logic is as follows:

    [CODE=perl]if (($fields[0] - $lat <= 0.20 && $fields[0] - $lat >= -0.20) && ($fields[1] - $long <= 0.20 && $fields[1] - $long >= -0.20)) {
    Action, print, etc.
    } # close if bracket[/CODE]

    ---
    Would be of much great assist if anyone can lend an idea to my last query in the above...
    See more | Go to post
    Last edited by eWish; Apr 7 '08, 03:32 AM. Reason: Please use code tags

    Leave a comment:


  • Thanks for the feedback folks.

    Quick Update on progress and a different question at bottom:

    Update:

    Eventually got the syntax right, and here is the current working view:

    [code=perl]

    #!/usr/bin/perl -w
    use strict;
    use warnings;

    use CGI qw(:standard);

    # GPS value derived from web-based javascript query to google's geocoder api. #...
    See more | Go to post

    Leave a comment:


  • Best to use If and conditions? or some other form of logic for this example

    Hi Folks,

    Wondering if my logic is bringing me down the right path..was hoping for some feedback before I spend too much time creating the source document / database to test it out.

    At a high level, what I'm trying to do is read through a database (CSV file) of GPS coordinates and general descriptions for devices that are deployed throughout a national geography. Rather than have every device in the database formatted...
    See more | Go to post

  • Thanks Mate, I was trying to steer clear of any modules. The SA won't allow any use of XYZ beyond basic perl functionality. Don't ask my=[me]-edit why. I'm just wearing the development hat as a one-off here.

    Just looking for basic perl functionality to do the task at hand.

    Cheers,

    Hutch
    See more | Go to post

    Leave a comment:


  • is there a perl mechanism to ping a network element before issuing SNMP commands?

    Since I found the site by googling, I will post a new question in addition to my follow-on response, with belief it will aid others. And increased crossing of fingers it will aid in receiving a response.

    Cutting to the chase.....

    i can use a system call to issue a ping to network element easily enough

    Ie, system("/directory1/directory2/command like i was in CLI");

    how can i harvest...
    See more | Go to post

  • hutch75
    replied to how to output excel to textfile?
    in Perl
    Hate to be redundant or insignificant in my response, yet here is my take.

    Based on my limited understanding and personal roadblocks.

    1) Reading/Looping Through an XLS file to extract data with perl is a $bear = killer koala

    2) My path of least resistance to overcome said $bear, has been to require the XLS file to be converted (via save as) to a CSV format.

    O.K -- I too am almost sick at...
    See more | Go to post

    Leave a comment:


  • Many thanks, the input twas not ignored despite my latency in responding.

    Helped a great deal... I will in turn follow up with posting the complete script when complete. Which, i trust, may help others along the way!

    The present enhancement I'm trying to integrate is a means to ping (query) a remote host before SNMPSET commands are issued to it. Have already integrated a mechanism to time-out based on number of attempts...
    See more | Go to post

    Leave a comment:


  • CSV to XML works o.k - having prob taking a field from the CSV to name the XML file

    Hi folks,

    I've been dead-ending on this issue, and I'm dusting off my brain to re-engage with Perl, so pls bear with me.

    Here's an example of what I'm trying to accomplish, have tried several variants to resolve; but am getting error mssgs to the effect of: Global symbol "@site" requires explicit package name at csvconvert-BETA.pl line 16.

    Overview is I'm uploading a .CSV file to a tmp directory...
    See more | Go to post
    Last edited by eWish; Feb 20 '08, 02:14 PM. Reason: Fixed Code Tags
No activity results to display
Show More
Working...