Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4234520
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T02:22:04+00:00 2026-05-21T02:22:04+00:00

My buddy gave me an idea for my VMware script written in perl, he

  • 0

My buddy gave me an idea for my VMware script written in perl, he said I should have a way to update the script with an argument like -u.

The problem is I have no idea how I could do that. The only things that come to mind on how I could update the script via the internet would be something will wget, my amazon S3 account or an FTP server.

Whats the easiest way to do something?

–update–

I revised my question and was thinking more about what I am trying to accomplish.

I guess I am pretty much trying to make is a quick and dirty script that does a simple version check to a server or site where I will host my scripts. I don’t know what options I can use yet all I got right now is a Dropbox and an amazon S3 account. I would think I could do something with S3.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T02:22:04+00:00Added an answer on May 21, 2026 at 2:22 am

    This is just an untested first draft, but you’ll get the idea:

    use strict;
    use warnings;
    use Getopt::Std;  # for getopts
    use LWP::Simple;  # for get
    
    my %opt; getopts('u',%opt);
    
    if ($opt{u}
    && -w $0
    && (my $newcontent = get("http://your.script.s/loca/tion"))
    && open(my $me, '<', $0))
    {
        $/ = 0;
        my $currcontent = <$me>;
        close($me);
        if ($newcontent ne $currcontent)
        {
            warn "updating to latest version ...\n";
            if (open($me, '>', $0))
            {
               print $me $newcontent;
               close($me);
               exec $0, @ARGV;  # call it - if that's what you want to do
            }
        }
    }
    

    Refactor the if nesting, add error handling, be more cautious about using $0, etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made my website My SMS Buddy and i have included one facebook like
My buddy read an OpenGL book that said interleaving your vertex pointers and the
I have a buddy that's having a hard time with the language barrier. I
I have this regex I built and tested in regex buddy. _ [ 0-9]{10}+
I have a buddy who is building the web server side of things and
So, the modern concept of the buddy list: Let's say we have a table
I have 100% ad hoc sql through out my application. A buddy of mine
My buddy and I are planning on porting a python app we have to
Is there any application like SQL Buddy for SQLite3 for Mac. I am just
can any buddy have any code in which with the help of api I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.