Need help with a small Perl script to display red screen

Discussion in 'Perl Misc' started by Matthew, Jan 18, 2004.

  1. Matthew

    Matthew Guest

    Hello, I am wanting to create a snippet of Perl code that I can put at
    the top of all my Perl scripts, so when someone externally tries to
    execute it directly it will run, stop, and then display a red screen
    without executing the rest of the code, however if a certain variable
    is passed -- lets say for the purposes of this example something from
    '$pass', then it will skip over this part and execute the complete
    file. Can someone help me write something like this -- it would be
    very much appreciated! :)

    Cheers!

    Matt
     
    Matthew, Jan 18, 2004
    #1
    1. Advertising

  2. In article <>,
    Matthew <> wrote:
    :Hello, I am wanting to create a snippet of Perl code that I can put at
    :the top of all my Perl scripts, so when someone externally tries to
    :execute it directly it will run, stop, and then display a red screen
    :without executing the rest of the code

    Perl has no inherent concept of 'red' or 'screen', so if you want
    this done, you will have to give us a hint about the acceptable
    constraints. For example, is this for use with the 7 segment Nixie
    tubes or the later 9 segment Nixies?
    --
    So you found your solution
    What will be your last contribution?
    -- Supertramp (Fool's Overture)
     
    Walter Roberson, Jan 18, 2004
    #2
    1. Advertising

  3. Matthew

    gnari Guest

    "Matthew" <> wrote in message
    news:...
    > Hello, I am wanting to create a snippet of Perl code that I can put at
    > the top of all my Perl scripts, so when someone externally tries to
    > execute it directly it will run, stop, and then display a red screen
    > without executing the rest of the code, however if a certain variable
    > is passed -- lets say for the purposes of this example something from
    > '$pass', then it will skip over this part and execute the complete
    > file. Can someone help me write something like this -- it would be
    > very much appreciated! :)


    version one:
    red_screen(),exit() if ($ENV{SECRET_ENVIRONMENT_VARIABLE} ne 'password');

    run it like this (from bash shell):
    SECRET_ENVIRONMENT_VARIABLE=password perl myprog.pl normalarg
    from other systems, set the environment variable, and run normally


    version 2:
    red_screen(),exit() if (shift() ne 'passwrd');

    run it like this
    SECRET_ENVIRONMENT_VARIABLE=1 perl myprog.pl password normalarg


    gnari
     
    gnari, Jan 18, 2004
    #3
  4. Matthew

    Tintin Guest

    "Matthew" <> wrote in message
    news:...
    > Hello, I am wanting to create a snippet of Perl code that I can put at
    > the top of all my Perl scripts, so when someone externally tries to
    > execute it directly it will run, stop, and then display a red screen
    > without executing the rest of the code, however if a certain variable
    > is passed -- lets say for the purposes of this example something from
    > '$pass', then it will skip over this part and execute the complete
    > file. Can someone help me write something like this -- it would be
    > very much appreciated! :)


    Define "external"
     
    Tintin, Jan 19, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dpackwood
    Replies:
    3
    Views:
    1,829
  2. moondaddy
    Replies:
    3
    Views:
    941
    Steven Cheng[MSFT]
    Jul 16, 2004
  3. Stuart J. Shillinglaw

    <<CSS>> Menu for Opera small screen

    Stuart J. Shillinglaw, Jun 6, 2005, in forum: HTML
    Replies:
    2
    Views:
    532
    Stuart J. Shillinglaw
    Jun 7, 2005
  4. James
    Replies:
    3
    Views:
    354
    Kevin Goodsell
    Nov 27, 2003
  5. Replies:
    2
    Views:
    407
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    May 10, 2008
Loading...

Share This Page