sachinz2 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I have a .pag file and I need to know what is the data it is storing, what is the the format of data.

Can I do so with any perl function, OR if there are any Modules which I can use, Please direct me

Thanks & Regards

Replies are listed 'Best First'.
Re: How do I read .pag files
by haukex (Archbishop) on Apr 12, 2017 at 08:15 UTC
    I have a .pag file and I need to know what is the data it is storing, what is the the format of data.

    According to Google this file extension is associated with at least six different programs/formats. Since we can't see your file, you'll have to do some investigating yourself. Do you have any idea who generated this file (ask them!), and with what software? If you really don't know, and you happen to be on a *NIX system, try these two commands: file FILENAME and hexdump -C FILENAME | head to get some hints as to what it might be.

Re: How do I read .pag files
by hippo (Archbishop) on Apr 12, 2017 at 08:33 UTC

    File::Type is designed for precisely this purpose.

Re: How do I read .pag files
by marto (Cardinal) on Apr 12, 2017 at 08:11 UTC
Re: How do I read .pag files
by Corion (Patriarch) on Apr 12, 2017 at 08:24 UTC

    Often a .pag file comes together with an .idx .dir file if it is a BerkeleyDB file. See DB_File.

    In general, you will have to hope that your Perl has the same version of BerkeleyDB as the generating program.

Re: How do I read .pag files
by sachinz2 (Acolyte) on Apr 12, 2017 at 11:10 UTC

    file FILENAME is giving 'data' as an output

    hexdump -C FILENAME | head gave no result

    What I was able to gather from Web is that , It .pag is a file format created by Activestate perl distribution

    Also, In my case, the file is being read/write using IO.pm .. so yes it is being created by a perl program

    Hope this helps, I cannot provide a code(not allowed to)

    Thanks & Regards

      A web search for "ActiveState pag" returns this which may be of interest, the remainder of the results don't look useful. Consider contacting ActiveState?

      file FILENAME is giving 'data' as an output

      hexdump -C FILENAME | head gave no result

      "file" would say "empty" if the file was empty, so hexdump must have generated output. What does the output of hexdump look like?

        $file filename.state.pag filename.state.pag: data
        $hexdump -C filename.state.pag hexdump: filename.state.pag: No such file or directory hexdump: filename.state.pag: Bad file descriptor