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

  • Home
  • SEARCH
  • 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 667617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:56:54+00:00 2026-05-13T23:56:54+00:00

I need to understand the working of this particular program, It seems to be

  • 0

I need to understand the working of this particular program, It seems to be quite complicated, could you please see if you could help me understanding what this program in Perl does, I am a beginner so I hardly can understand whats happening in the code given on the following link below, Any kind of guidance or insights wrt this program is highly appreciated. Thank you…:)
This program is called premove.pl.c

Its associated with one more program premove.pl,
Its code looks like this:

#!perl

open (newdata,">newdata.txt") 
|| die("cant create new file\n");#create passwd file
$linedata = "";
while($line=<>){
chomp($line);
#chop($line);
print newdata $line."\n";
}
close(newdata);
close(olddata);

__END__

I am even not sure how to run the two programs mentioned here. I wonder also what does the extension of the first program signify as it has “pl.c” extension, please let me know if you know what it could mean. I need to understand it asap thats why I am posting this question, I am kind of short of time else I would try to figure it out myself, This seems to be a complex program for a beginner like me, hope you understand. Thank you again for your time.

  • 1 1 Answer
  • 1 View
  • 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-13T23:56:54+00:00Added an answer on May 13, 2026 at 11:56 pm

    First, regarding the perl code you posted:

    See:

    • perlfunc open
    • perlfunc chmop
    • perlop on IO Operators, especially the null filehandle.

    This is some atrociously bad code. I rewrote it for you without all the obfuscation and foolishness. This should be a bit more understandable.

    #!perl
    use strict;
    use warnings;
    use IO::File;
    
    my $newdata = IO::File->new( 'newdata.txt', '>' )
        or die "Unable to open newdata - $!\n";
    
    while( my $line = <> ) {
    
        $newdata->print( $line );
    
    }
    

    The main thing that is likely to be confusing is the <> or null filehandle read. Here it grabs a line from any files listed in program args, or if no arguments provided, it reads STDIN.

    This script is essentially cat filename > newdata.txt

    As for premove.pl.c, I’m no internals expert, but it looks like the author took an example for how to embed a Perl interpreter in a C program and pasted it into an oddly named file.
    It looks to me like its will compile down to something equivalent to perl. In short, another useless artifact. Was the person who produced this paid by the line?

    If this is the state of the code you’ve inherited, I feel sorry for you.

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

Sidebar

Related Questions

Perl newbie here...I had help with this working perl script with some HASH code
I can't understand why my javascript isn't working... Do i need to declare a
I need to understand how this is possible, i.e. I would like to understand
I don't know if this is a right question, but i need to understand
I edited this question after i found a solution... i need to understand why
This is trivial, probably silly, but I need to understand what state cout is
I don't understand the need for self-joins. Can someone please explain them to me?
I was working on understanding what the implications of granting a package a particular
Once again I need some help. I'm working with a table that contains 3
I need to understand how to create a simple animation in HTML 5 or

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.